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

Mac OSX specific forum
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

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

Post 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
Last edited by Niffo on Tue Mar 25, 2014 12:48 pm, edited 4 times in total.
Niffo
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: 5.22 - CanvasGadget does not trigger events with Command

Post 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
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Re: 5.22 - CanvasGadget does not trigger events with Command

Post 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)
Niffo
Post Reply