Need a little help in recognizing when just the control key is being pressed from inside a created window. Control key in combination with another key is working okay. Much appreciated for the help!
Code: Select all
EnableExplicit
Global gEvent.i, gDone.i = 0
Enumeration 1
  #KEYBOARD_CONTROL
  #KEYBOARD_Q_CONTROL
  #KEYBOARD_ESC
EndEnumeration
Debug "Hello!"
If OpenWindow(1,0,0,1024,768,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  AddKeyboardShortcut(1,#PB_Shortcut_Control, #KEYBOARD_CONTROL)
  AddKeyboardShortcut(1,#PB_Shortcut_Q | #PB_Shortcut_Control, #KEYBOARD_Q_CONTROL)
  AddKeyboardShortcut(1,#PB_Shortcut_Escape, #KEYBOARD_ESC)
  
  Repeat
    gEvent = WaitWindowEvent(5)
    If gEvent = #PB_Event_CloseWindow
      gDone = 1
    EndIf
    
    If gEvent = #PB_Event_Menu
      If EventMenu() = #KEYBOARD_Q_CONTROL
        Debug "Q + CONTROL"
      EndIf
      If EventMenu() = #KEYBOARD_CONTROL
        Debug "CONTROL"
      EndIf
      If EventMenu() = #KEYBOARD_ESC
        gDone = 1
      EndIf
    EndIf
  Until gDone = 1
EndIf
If IsWindow(1)
  CloseWindow(1)
EndIf
EndBruce

