RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Just starting out? Need help? Post your questions and find answers here.
ozzie
Enthusiast
Enthusiast
Posts: 429
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Post 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).
PB Fanatic
User
User
Posts: 49
Joined: Wed Dec 17, 2014 11:54 am

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Post 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.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Post 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).
jassing
Addict
Addict
Posts: 1745
Joined: Wed Feb 17, 2010 12:00 am

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

Post 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.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: RemoveKeyboardShortcut with #PB_Shortcut_All kills tab

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