title: PureBasic - how can i simulate pressing F1 or F2 keyboard button?
body: <p>From Linux i am trying to make a small executable file for Windows 7/8 and Mac.
  with <a href="http://en.wikipedia.org/wiki/PureBasic." rel="nofollow noreferrer">PureBasic language</a>.
  How can i press F1 or F2 keyboard button using PureBasic? 
  I tried following but getting a linker error.</p>
  
  <p><img src="https://i.stack.imgur.com/mVwsH.png" alt="enter image description here"></p>
  
  <pre><code>If OpenWindow(0, #PB_Ignore, #PB_Ignore, 200, 200, "Shortcut test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  
     AddKeyboardShortcut(0, #PB_Shortcut_Apps,101);      (=) - somewhere near the Space key
     AddKeyboardShortcut(0, #PB_Shortcut_Clear,102)
     AddKeyboardShortcut(0, #PB_Shortcut_Command,103)
     AddKeyboardShortcut(0, #PB_Shortcut_Execute,104)
     AddKeyboardShortcut(0, #PB_Shortcut_Help,105)
     AddKeyboardShortcut(0, #PB_Shortcut_Menu,106)
     ;AddKeyboardShortcut(0, #PB_Shortcut_Next,107)
     AddKeyboardShortcut(0, #PB_Shortcut_Pause,108);      Pause - should be beside F12 or so
     AddKeyboardShortcut(0, #PB_Shortcut_Print,109)
     ;AddKeyboardShortcut(0, #PB_Shortcut_Prior,110)
     AddKeyboardShortcut(0, #PB_Shortcut_Scroll,111);      ScrollLock
     AddKeyboardShortcut(0, #PB_Shortcut_Select,112)
     AddKeyboardShortcut(0, #PB_Shortcut_Separator,113)
     AddKeyboardShortcut(0, #PB_Shortcut_Snapshot,114)
  
     Repeat
        Select WaitWindowEvent()
        Case #PB_Event_Menu
           z=EventMenu()
           If z&gt;99 And z&lt;115
              Debug "Found key for the event #"+Str(z)
           EndIf
        Case #PB_Event_CloseWindow
           Break
        EndSelect
     ForEver
  
  EndIf
  </code></pre>