0
從Linux我想爲Windows 7/8和Mac做一個小的可執行文件。 與PureBasic language。 如何使用PureBasic按F1或F2鍵盤按鈕? 我試過,但得到一個鏈接錯誤。PureBasic - 如何模擬按F1或F2鍵盤按鈕?
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>99 And z<115
Debug "Found key for the event #"+Str(z)
EndIf
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf