Page 1 of 1

[Not a Bug] 5.22 - CanvasGadget with "Command" key

Posted: Mon Mar 24, 2014 8:39 pm
by Niffo
CanvasGadget does not trigger "mouse clic" events when the Command key is pressed. So it is not possible to do, by example, multi-selection.
(I was able to do it before when i used APIs instead of CanvasGadget)

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "Test")
CanvasGadget(0, 10, 10, 280, 180)

Repeat
   Select WaitWindowEvent()
      Case #PB_Event_Gadget
         Select EventGadget()
            Case 0 ; CanvasGadget
               Debug EventType()
         EndSelect
      Case #PB_Event_CloseWindow
         Break
   EndSelect
ForEver

Re: 5.22 - CanvasGadget does not trigger events with Command

Posted: Mon Mar 24, 2014 9:16 pm
by Danilo
Seems to work here:

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "Test")
CanvasGadget(0, 10, 10, 280, 180);,#PB_Canvas_Keyboard)

Repeat
   Select WaitWindowEvent()
      Case #PB_Event_Gadget
         Select EventGadget()
            Case 0 ; CanvasGadget
                event = EventType()
                Debug event
                
                modKey.s = ""
                keys = GetGadgetAttribute(0,#PB_Canvas_Modifiers)
                If keys & #PB_Canvas_Shift   : modKey + "SHIFT "   : EndIf
                If keys & #PB_Canvas_Alt     : modKey + "ALT "     : EndIf
                If keys & #PB_Canvas_Control : modKey + "CONTROL " : EndIf
                If keys & #PB_Canvas_Command : modKey + "COMMAND " : EndIf
                If modKey
                    Debug modKey
                EndIf
                If event = #PB_EventType_LeftClick
                    Debug "Left Click"
                ElseIf event = #PB_EventType_RightClick
                    Debug "Right Click"
                EndIf
         EndSelect
      Case #PB_Event_CloseWindow
         Break
   EndSelect
ForEver

Re: 5.22 - CanvasGadget does not trigger events with Command

Posted: Tue Mar 25, 2014 12:42 pm
by Niffo
Sorry, you can ignore this report, my problem was due to a glitch in using virtualisation (Command key partially hooked by host OS)