AddKeyboardShortcut fails on shift+padXX

Windows specific forum
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

AddKeyboardShortcut fails on shift+padXX

Post 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
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

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

Post by Mistrel »

Can you provide a reference for the EV_KS constants? Where are you getting these?
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post by skywalk »

I just made them, you can change them.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

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

Post by Paul »

Maybe #PB_Shortcut_Insert is taking priority over #PB_Shortcut_Shift|#PB_Shortcut_Pad0 for some reason ?
Image Image
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

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

Post by RASHAD »

Egypt my love
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post by skywalk »

Doh :evil:
That explains it. Shared NumLock with Shift key.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply