Created
May 22, 2025 04:03
-
-
Save orange-in-space/d9de4242db6bf70e3ca5f6b0e4063bad to your computer and use it in GitHub Desktop.
Simple Send Copilot Key(Copilotキーを送出するだけのやつ><)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Simple Send Copilot Key | |
| // | |
| // (c) orange_in_space, 2018,2025 | |
| // Licence: CC0 | |
| // | |
| // HowToUse: | |
| // Simply executing this will send out a Copilot key. | |
| // | |
| // Build: | |
| // VC++2017 or later. "/SUBSYSTEM:WINDOWS" | |
| // | |
| //#include "pch.h" | |
| #include <iostream> | |
| #include <windows.h> | |
| void SendKeyDown(WORD keycode) | |
| { | |
| INPUT data; | |
| memset(&data, 0, sizeof(data)); | |
| data.type = INPUT_KEYBOARD; | |
| data.ki.wVk = keycode; | |
| data.ki.wScan = MapVirtualKey(keycode, 0); | |
| data.ki.dwFlags = KEYEVENTF_EXTENDEDKEY; | |
| SendInput(1, &data, sizeof(INPUT)); | |
| } | |
| void SendKeyUp(WORD keycode) | |
| { | |
| INPUT data; | |
| memset(&data, 0, sizeof(data)); | |
| data.type = INPUT_KEYBOARD; | |
| data.ki.wVk = keycode; | |
| data.ki.wScan = MapVirtualKey(keycode, 0); | |
| data.ki.dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP; | |
| SendInput(1, &data, sizeof(INPUT)); | |
| } | |
| void SendCopilotKey() | |
| { | |
| SendKeyDown(VK_LSHIFT); | |
| SendKeyDown(VK_LWIN); | |
| SendKeyDown(VK_F23); | |
| SendKeyUp(VK_F23); | |
| SendKeyUp(VK_LWIN); | |
| SendKeyUp(VK_LSHIFT); | |
| } | |
| int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) | |
| { | |
| SendCopilotKey(); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment