No keydown event for tab on a canvas
Posted: Sun Sep 24, 2023 3:32 pm
Hello,
On Windows 11 with PB 6.03b9, there is no KeyDown event for tab key on a canvas gadget, but there is one for KeyUp.
On Windows 11 with PB 6.03b9, there is no KeyDown event for tab key on a canvas gadget, but there is one for KeyUp.
Code: Select all
Procedure CanvasCallback_KeyUp()
Debug "KeyUp: " + GetGadgetAttribute(0, #PB_Canvas_Key)
EndProcedure
Procedure CanvasCallback_KeyDown()
Debug "KeyDown: " + GetGadgetAttribute(0, #PB_Canvas_Key)
EndProcedure
OpenWindow(0, 0, 0, 200, 200, "Canvas key event", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 10, 10, 180, 180, #PB_Canvas_Keyboard)
BindGadgetEvent(0, @CanvasCallback_KeyDown(), #PB_EventType_KeyDown)
BindGadgetEvent(0, @CanvasCallback_KeyUp(), #PB_EventType_KeyUp)
SetActiveGadget(0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow