How can I use all the key with shortcut menu, please ?
If I try to tape the B key, it doesn't work.
Code: Select all
Enumeration
#Win_0
EndEnumeration
flag = #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_WindowCentered
If OpenWindow(#Win_0, 0,0,800, 600, "Shorcut & String gadget", flag)
CreateMenu(0,WindowID(#win_0))
MenuTitle("File")
MenuItem(0,"test")
AddKeyboardShortcut(0,#PB_Shortcut_B,0)
StringGadget(0,10,10,120,20,"")
EndIf
Repeat
EventID =WaitWindowEvent()
Select EventID
Case #PB_Event_Menu
Select EventMenu()
Case 0
If focus = 0
MessageRequester("info","just to test the menu")
EndIf
EndSelect
Case #PB_Event_CloseWindow
quit=1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_Focus
focus = 1
Case #PB_EventType_LostFocus
focus = 0
Case #PB_EventType_Change
Debug GetGadgetText(0) ; please try to type the B key !
EndSelect
EndSelect
EndSelect
Until quit
End
Thank you
