Posted: Thu Nov 29, 2007 5:22 pm
You're in luck. The StringGadget supports two very handy events, #PB_EventType_Focus and #PB_EventType_LostFocus. So you can have your shortcut active only when the string gadget has the focus and at no other time:
..and the ding is defeated. Amnesty 1, Gates 0.
Code: Select all
Select Event
Case #PB_Event_Gadget
Select gadget
Case mystring
Select EventType()
Case #PB_EventType_Focus
;AddKeyboardShortcut([..])
Case #PB_EventType_LostFocus
;RemoveKeyboardShortcut([..])
EndSelect
EndSelect
EndSelect