Page 1 of 1

AddKeyboardShortcut fails on shift+padXX

Posted: Mon Oct 07, 2019 8:19 pm
by skywalk

Code: Select all

EnableExplicit
Define.i evWW, evM
#EV_KS_0          = 100
#EV_KS_Pad0       = 101
#EV_KS_SHIFT_0    = 102
#EV_KS_SHIFT_Pad0 = 103
If OpenWindow(0, 0, 0, 220, 220, "BUG v571 - Shift+Padn menu event?", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(1, 10, 20, 150, 32, "ABC")
  AddKeyboardShortcut(0, #PB_Shortcut_0, #EV_KS_0)
  AddKeyboardShortcut(0, #PB_Shortcut_Pad0, #EV_KS_Pad0)
  AddKeyboardShortcut(0, #PB_Shortcut_Shift | #PB_Shortcut_0, #EV_KS_SHIFT_0)
  AddKeyboardShortcut(0, #PB_Shortcut_Shift | #PB_Shortcut_Pad0, #EV_KS_SHIFT_Pad0)
  Repeat
    evWW = WaitWindowEvent()
    Select evWW
    Case #PB_Event_Menu
      evM = EventMenu()
      ;ClearDebugOutput()
      If evM = #EV_KS_0
        Debug "Just 0"
      ElseIf evM = #EV_KS_Pad0
        Debug "Pad0"
      ElseIf evM = #EV_KS_SHIFT_0
        Debug "Shift+0"
      ElseIf evM = #EV_KS_SHIFT_Pad0
        Debug "Shift+Pad0"
      EndIf
    Case #PB_Event_CloseWindow
      Break
    EndSelect
  ForEver
EndIf

Re: [BUG-v571] AddKeyboardShortcut fails on shift+padXX

Posted: Tue Oct 08, 2019 6:44 am
by Mistrel
Can you provide a reference for the EV_KS constants? Where are you getting these?

Re: [BUG-v571] AddKeyboardShortcut fails on shift+padXX

Posted: Tue Oct 08, 2019 12:49 pm
by skywalk
I just made them, you can change them.

Re: [BUG-v571] AddKeyboardShortcut fails on shift+padXX

Posted: Tue Oct 08, 2019 1:45 pm
by Paul
Maybe #PB_Shortcut_Insert is taking priority over #PB_Shortcut_Shift|#PB_Shortcut_Pad0 for some reason ?

Re: [BUG-v571] AddKeyboardShortcut fails on shift+padXX

Posted: Wed Oct 09, 2019 6:59 pm
by RASHAD

Re: [BUG-v571] AddKeyboardShortcut fails on shift+padXX

Posted: Wed Oct 09, 2019 10:05 pm
by skywalk
Doh :evil:
That explains it. Shared NumLock with Shift key.