Page 1 of 1

AddKeyboardShortcut

Posted: Tue Nov 20, 2012 8:00 pm
by lavachri
Hi,
why the shortcuts Alt+Prior and Alt+Next don't work ?

Code: Select all

If OpenWindow(0, 0, 0, 322, 205, "Test raccourcis Alt+Prior", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    StringGadget(0, 8,  10, 306, 20, "")
    SetActiveGadget( 0)
    AddKeyboardShortcut(0, #PB_Shortcut_Alt + #PB_Shortcut_Prior, 1 )
    AddKeyboardShortcut(0, #PB_Shortcut_Alt + #PB_Shortcut_Home, 2 )
    Repeat 
      EV = WaitWindowEvent()
      If ev = #PB_Event_Menu
        Select EventMenu()
        Case 1
          SetGadgetText( 0, "Prior" )
        Case 2
          SetGadgetText( 0, "Home")
        EndSelect
      EndIf
    Until EV = #PB_Event_CloseWindow
  EndIf
Thanks

Re: AddKeyboardShortcut

Posted: Tue Nov 20, 2012 8:07 pm
by jesperbrannmark
Change

Code: Select all

AddKeyboardShortcut(0, #PB_Shortcut_Alt + #PB_Shortcut_Prior, 1 )
    AddKeyboardShortcut(0, #PB_Shortcut_Alt + #PB_Shortcut_Home, 2 )
To

Code: Select all

AddKeyboardShortcut(0, #PB_Shortcut_Alt | #PB_Shortcut_Prior, 1 )
    AddKeyboardShortcut(0, #PB_Shortcut_Alt | #PB_Shortcut_Home, 2 )
And it will hopefully work better

Re: AddKeyboardShortcut

Posted: Tue Nov 20, 2012 11:06 pm
by MachineCode
The original example works fine here with + instead of |.

Re: AddKeyboardShortcut

Posted: Wed Nov 21, 2012 9:00 am
by lavachri
Hi,
i know + and | are different operator but it's possible to add modifiers and one key.

Sorry, i have found the problem...
It's skype and this globals shortcuts...

Re: AddKeyboardShortcut

Posted: Wed Jun 22, 2016 1:50 pm
by mestnyi

Code: Select all

#PB_Shortcut_Alt

How to distinguish clamped right or left?