-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devdraw: Modifier keys are not sent #600
Comments
A simple solution that fixes both of the problems described above is to send each individual modifier keystroke as it happens, then the clients can maintain the modifier state and do whatever they want, including mouse presses with modifier. This breaks existing clients, because they're not expecting these keys to come through, so they show up as unknown text in (e.g.: in acme), therefore it's not a proper solution, but maybe it helps for anyone else reading this who needs to access modifiers in their devdraw programs From c85b5c92f6ba63ff3e2866c67108596ffb78124c Mon Sep 17 00:00:00 2001
From: zakkor <[email protected]>
Date: Mon, 30 Jan 2023 09:55:27 +0200
Subject: [PATCH] devdraw: Forward individual modifier keypresses
---
src/cmd/devdraw/mac-screen.m | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/cmd/devdraw/mac-screen.m b/src/cmd/devdraw/mac-screen.m
index f07054cf9..91ccb0171 100644
--- a/src/cmd/devdraw/mac-screen.m
+++ b/src/cmd/devdraw/mac-screen.m
@@ -640,6 +640,12 @@ - (void)flagsChanged:(NSEvent*)e
[self sendmouse:b];
}else if(m & ~omod & NSEventModifierFlagOption)
gfx_keystroke(self.client, Kalt);
+ else if(m & ~omod & NSEventModifierFlagCommand)
+ gfx_keystroke(self.client, Kcmd);
+ else if(m & ~omod & NSEventModifierFlagControl)
+ gfx_keystroke(self.client, Kctl);
+ else if(m & ~omod & NSEventModifierFlagShift)
+ gfx_keystroke(self.client, Kshift);
omod = m;
} |
KeyCmd+'a'
-style modifiers can be checked. Shift+special keys, Cmd+special keys, and Alt+any key all cannot be checked.The text was updated successfully, but these errors were encountered: