Found an issue in SpiderBasic ? Please report it here !
poshu
 
Posts: 96
Joined: Mon Feb 24, 2014 11:46 pm

GetGadgetAttribute() returns wrong value with #PB_Canvas_Key

by poshu Wed Feb 19, 2020 10:41 am

Code: Select all
Procedure HandlerCanvas()
   If EventType() = #PB_EventType_KeyUp
      Select GetGadgetAttribute(0,#PB_Canvas_Key)
         Case #PB_Shortcut_Left,#PB_Shortcut_Right,#PB_Shortcut_Up,#PB_Shortcut_Down
            Debug "right value"
         Case #PB_Key_Left,#PB_Key_Right,#PB_Key_Up,#PB_Key_Down
            Debug "wrong value"
      EndSelect
   EndIf
EndProcedure

OpenWindow(0,0,0,450,450,"Press an arrow...")
CanvasGadget(0,0,0,450,450,#PB_Canvas_Keyboard)
BindGadgetEvent(0,@HandlerCanvas())
SetActiveGadget(0)

According to the documentation, GetGadgetAttribute(canvasid,#PB_Canvas_Key) should return #PB_Shortcut values, but it's actually returning #PB_Key values
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 1 guest