mirror of
https://github.com/bradgrantham/apple2e.git
synced 2024-06-16 23:29:33 +00:00
fix paste to only work with SUPER key (CMD on Mac), fix #4
This commit is contained in:
parent
e9453b7fe7
commit
97e5923939
|
@ -890,16 +890,16 @@ static void key(GLFWwindow *window, int key, int scancode, int action, int mods)
|
||||||
static bool super_down = false;
|
static bool super_down = false;
|
||||||
|
|
||||||
if(action == GLFW_PRESS) {
|
if(action == GLFW_PRESS) {
|
||||||
if(key == GLFW_KEY_RIGHT_SUPER)
|
if(key == GLFW_KEY_RIGHT_SUPER || key == GLFW_KEY_LEFT_SUPER)
|
||||||
super_down = true;
|
super_down = true;
|
||||||
else if(key == GLFW_KEY_V) {
|
else if(super_down && key == GLFW_KEY_V) {
|
||||||
const char* text = glfwGetClipboardString(window);
|
const char* text = glfwGetClipboardString(window);
|
||||||
if (text)
|
if (text)
|
||||||
event_queue.push_back({PASTE, 0, strdup(text)});
|
event_queue.push_back({PASTE, 0, strdup(text)});
|
||||||
} else
|
} else
|
||||||
event_queue.push_back({KEYDOWN, key});
|
event_queue.push_back({KEYDOWN, key});
|
||||||
} else if(action == GLFW_RELEASE) {
|
} else if(action == GLFW_RELEASE) {
|
||||||
if(key == GLFW_KEY_RIGHT_SUPER)
|
if(key == GLFW_KEY_RIGHT_SUPER || key == GLFW_KEY_LEFT_SUPER)
|
||||||
super_down = false;
|
super_down = false;
|
||||||
event_queue.push_back({KEYUP, key});
|
event_queue.push_back({KEYUP, key});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user