Comments (2)
Yes, I haven't bothered to implement per window modifier state tracking.
What's the use case for this? Note that even with OS window focus
changes you cannot actually use modifier press/release events to track
modifier state reliably. Because glfw doesn't send synthetic press
events for depressed modifiers when an OS window gains focus. But it
does send synthetic release events. That these events are synthetic from
glfw is easily verified by running kitty with --debug-input.
Don't ask me why it works this way, but it does so on both X11 and
macOS. I am guessing it was some hack put in place a while ago for some
specific use case.
To me it would make more sense to not report the synthetic release
events on focus out at all. In general once focus out is allowed an
application simply cannot track modifier state, since anything could
happen to the modifier state while the application is unfocused and it
will have no way to know that. This applies for both graphical
applications and terminal applications using the keyboard protocol.
One would really need to implement some kind of modifier state update
event on focus in to do this reliably. But I am sceptical that this is
actually needed for a real world use case.
from kitty.
I am using modifier key events to control hover behaviours in my text editor (neurocyte/flow on github). I understand that it is unlikely to be perfect and I will have to use modifier bits from other events to detect unexpected modifier state changes.
That being said, I opened this issue mostly because of the difference in behaviour between kitty's internal windows switching and OS window switching.
- OS window switching sends a release event on focus change. This event zeros the modifier bits unconditionally.
- Kitty window switching there are no events on focus change and the effective modifier state in the application "sticks" until focus returns and some other event with modifier bits is sent.
At very least I'd like this to be consistent. Either leave the state as sticky in both cases or release in both cases. As it is now the modifier state may or may not stick depending on how the focus left the terminal, which is a little confusing.
An ideal solution, as you say, would be to have focus/unfocus events that also report the current modifier state and leave it up to the application to implement sticky or non-sticky behaviour. But I really think that should be a separate discussion. This is just about consistency for me.
from kitty.
Related Issues (20)
- Crash on startup HOT 3
- After upgrading from 0.36.1 to 0.36.2, when starting kitty with --session all dirs are set to ~
- kitty fails to build on OpenBSD HOT 1
- Keyboard mapping `map cmd+< next_tab` does not work on Mac in 0.36.2 HOT 3
- Brahmic Character Support HOT 1
- Use mac native shortcuts HOT 2
- Getting remote control disabled but nothing is trying to control kitty HOT 3
- Setting for initial layout (horizontal/vertical) when opening up a window inside kitty HOT 2
- macos_option_as_alt is not honored when CAPS_LOCK is ON
- Process (kitty) dumped core (SIGSEGV) with custom session on Wayland with binary NVIDIA driver HOT 1
- Middle click in Vim/NeoVim over SSH can not paste from the primary selection but the normal clipboard. HOT 2
- Rendering of `U+25cb` is less than ideal
- control key not recognized on macos HOT 4
- kitty crashes when trying to use Hack Nerd Font. HOT 1
- kitty @ env can not remove variable from environment
- Startup Session example throws error HOT 1
- can't launch kitty with --single-instance in macos-launch-services-cmdline HOT 19
- Border between windows became thick HOT 1
- `kitten @ run kitten @ --to $KITTY_LISTEN_ON ls` timeout HOT 1
- Window borders are not drawn when "background_opacity" option is set to 0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitty.