Page 1 of 1

RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Posted: Thu Jan 01, 2015 9:48 am
by ozzie
If I use RemoveKeyboardShortcut with #PB_Shortcut_All then this prevents the tab key from tabbing between fields.

For example, in this program you cannot tab through the fields unless you comment out 'RemoveKeyboardShortcut(0, #PB_Shortcut_All)':

Code: Select all

If OpenWindow(0, 0, 0, 305, 240, "Shortcut Tab Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(1,100,30,80,20,"1")
  StringGadget(2,100,60,80,20,"2")
  StringGadget(3,100,90,80,20,"3")
  SetActiveGadget(1)

  RemoveKeyboardShortcut(0, #PB_Shortcut_All)
  
  Repeat
    giWindowEvent = WaitWindowEvent()
  Until giWindowEvent = #PB_Event_CloseWindow
EndIf
Using PB 5.31 (x86).

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Posted: Thu Jan 01, 2015 10:18 am
by PB Fanatic
It's not a bug because the manual says for AddKeyboardShortcut:
By default, a window already has the #PB_Shortcut_Tab and #PB_Shortcut_Tab|#PB_Shortcut_Shift shortcuts to handle tab and shift-tab correctly trough the gadgets.
So by invoking RemoveKeyboardShortcut with #PB_Shortcut_All, you're purposely making a decision to remove those default shortcuts as well.

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Posted: Mon Jan 05, 2015 10:16 pm
by Rescator
If I recall correctly, the reason why RemoveKeyboardShortcut() and #PB_Shortcut_All removes the TAB as well, was that some developers wanted/needed to re-purpose the TAB key or "disable" it, and this is the only way to do that (IIRC).

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Posted: Tue Jan 06, 2015 2:21 pm
by jassing
Rescator wrote:If I recall correctly, the reason why RemoveKeyboardShortcut() and #PB_Shortcut_All removes the TAB as well, was that some developers wanted/needed to re-purpose the TAB key or "disable" it, and this is the only way to do that (IIRC).
If there were only a way to query what a hot key points to -- you could save the ones you want, do a remove all, then restore the ones you want, like tab.

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Posted: Tue Jan 06, 2015 4:57 pm
by Vera
Hi, just a small note.

Whatever you decide what 'remove #PB_Shortcut_All' is supposed to do, it'll stay kind of insufficient for one OS or the other (or 2 ?).

On Linux the tab-function is effective either way ;-)