You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request / question: Get modifier keys on keyboard event #5318
To fully support the keyboard in my application, I would need to be able to get the current state of the modifier keys (shift,control,meta).
The key event does not provide that. For example if I press the return key, I see no difference if I press return with or without space key.
Interestingly Mouse events seem to support it, but I do not want to wait for a mouse event to fire -- the interactions should be triggered from the keyboard alone.
It also could be a separate function to get that state, but it really would make my application possible, since I would need to find another way of implementing it, if it is not possible in textual.
Is there a way to do that already (I scanned the documentation and FAQ but found nothing yet)? If not, would it be possible to integrate such a functionality in reasonable time?
Could that be available with "Extended keys" #3411 ? That would also be a possibility for me, to use such a terminal, but I saw no possibility to integrate it into the current Key event structure, so I did not try a terminal with that support yet.
Activity
github-actions commentedon Dec 2, 2024
Thank you for your issue. Give us a little time to review it.
PS. You might want to check the FAQ if you haven't done so already.
This is an automated reply, generated by FAQtory
willmcgugan commentedon Dec 2, 2024
Modifiers are encoded in the key name, but you will need a terminal that supports the extended key protocol to use them.
novak-services commentedon Dec 4, 2024
Thank you VERY MUCH.
That was really helpful. I tried it with WezTerm and works like a charm and I get now all information my Application needs.
I am getting more and more into Textual and it is real great.
github-actions commentedon Dec 4, 2024
Don't forget to star the repository!
Follow @textualizeio for Textual updates.