1    local char_callback (window : GlfwWindow) (codepoint : uint) =
2        if codepoint < 128 then
3            let char = codepoint as Char
4            let os_window = windows[window]
5            os_window.chars.push char
6    
7    local key_callback (window : GlfwWindow
8                        key : Key
9                        scancode : int
10                       action : KeyAction
11                       mods : KeyModifiers) =
12       let os_window = windows[window]
13       os_window.keys.push (key, action, mods)
14   
15   local mouse_button_callback (window : GlfwWindow
16                                button : MouseButton
17                                action : MouseAction
18                                mods : KeyModifiers) =
19       let os_window = windows[window]
20       os_window.mouse_buttons.push (button, action, mods)
21   
22   local size_callback (window : GlfwWindow
23                        width : int
24                        height : int) =
25       let os_window = windows[window]
26       os_window.width = width as u32
27                 height = height as u32
28                 sizes.push (os_window.width, os_window.height)
29   
30   local mouse_scroll_callback (window : GlfwWindow
31                                offset_x : f64
32                                offset_y : f64) =
33       let os_window = windows[window]
34       os_window.mouse_scrolls.push (offset_x as f32, offset_y as f32)
35   
36   local iconify_callback (window : GlfwWindow) (iconified : int) =
37       let os_window = windows[window]
38       let event = if iconified == 1
39                   then WindowEvent/Iconified
40                   else WindowEvent/Deiconified
41   
42       os_window.events.push event
43   
44   local maximize_callback (window : GlfwWindow) (maximized : int) =
45       let os_window = windows[window]
46       let event = if maximized == 1
47                   then WindowEvent/Maximized
48                   else WindowEvent/Unmaximized
49   
50       os_window.events.push event
51