diff --git a/src/callbacks.jl b/src/callbacks.jl index 9a526d8..4fc8586 100644 --- a/src/callbacks.jl +++ b/src/callbacks.jl @@ -50,7 +50,7 @@ returns `Signal{NTuple{4, Int}}` """ function keyboard_buttons(window, s::Signal{NTuple{4, Int}}=Signal((0,0,0,0))) keydict = Dict{Int, Bool}() - GLFW.SetKeyCallback(window, (window, button::Cint, scancode::Cint, action::Cint, mods::Cint) -> begin + GLFW.SetKeyCallback(window, (window, button, scancode, action, mods) -> begin push!(s, (Int(button), Int(scancode), Int(action), Int(mods))) end) s @@ -62,7 +62,7 @@ containing the pressed button the action and modifiers. [GLFW Docs](http://www.glfw.org/docs/latest/group__input.html#ga1e008c7a8751cea648c8f42cc91104cf) """ function mouse_buttons(window, s::Signal{NTuple{3, Int}}=Signal((0,0,0))) - GLFW.SetMouseButtonCallback(window, (window, button::Cint, action::Cint, mods::Cint) -> begin + GLFW.SetMouseButtonCallback(window, (window, button, action, mods) -> begin push!(s, (Int(button), Int(action), Int(mods))) end) s diff --git a/src/events.jl b/src/events.jl index ec3cb2b..0d94432 100644 --- a/src/events.jl +++ b/src/events.jl @@ -17,7 +17,7 @@ end function add_complex_signals!(screen) @materialize keyboard_buttons, mouse_buttons = screen.inputs - + no_scancode = map(remove_scancode, keyboard_buttons) button_s = merge( @@ -47,12 +47,12 @@ Builds a Set of keys, accounting for released and pressed keys """ function currently_pressed_keys(v0::Set{Int}, button_action_mods) button, action, mods = button_action_mods - if button != GLFW.KEY_UNKNOWN - if action == GLFW.PRESS + if button != Int(GLFW.KEY_UNKNOWN) + if action == Int(GLFW.PRESS) push!(v0, button) - elseif action == GLFW.RELEASE + elseif action == Int(GLFW.RELEASE) delete!(v0, button) - elseif action == GLFW.REPEAT + elseif action == Int(GLFW.REPEAT) # nothing needs to be done, besides returning the same set of keys else error("Unrecognized enum value for GLFW button press action: $action") diff --git a/src/screen.jl b/src/screen.jl index d32c571..1368279 100644 --- a/src/screen.jl +++ b/src/screen.jl @@ -505,7 +505,7 @@ function destroy!(screen::Screen) end if nw.handle != C_NULL GLFW.DestroyWindow(nw) - nw.handle = C_NULL + # nw.handle = C_NULL end else # delete from parent filter!(s-> !(s===screen), screen.parent.children) # remove from parent