[GH-ISSUE #45] Only shift key press event #33

Closed
opened 2026-03-04 01:01:16 +03:00 by kerem · 1 comment
Owner

Originally created by @Hecatoncheir on GitHub (Jan 26, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/45

Hi,
I need handle only shift key press event. Without other keys with shift.
How I can do that?

Originally created by @Hecatoncheir on GitHub (Jan 26, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/45 Hi, I need handle only shift key press event. Without other keys with shift. How I can do that?
kerem closed this issue 2026-03-04 01:01:16 +03:00
Author
Owner

@rivo commented on GitHub (Jan 26, 2018):

Hi,

I don't think terminals provide us with that information. I'm using tcell to process key events. They give some information here:

For example, if the rune is 'A', this will be reported without the ModShift bit set, since really can't tell if the Shift key was pressed (it might have been CAPSLOCK, or a terminal that only can send capitals, or keyboard with separate capital letters from lower case letters).

Generally, terminal applications have far less visibility into keyboard activity than graphical applications. Hence, they should avoid depending overly much on availability of modifiers, or the availability of any specific keys.

So I'm afraid you won't be able to listen to Shift key events.

<!-- gh-comment-id:360752358 --> @rivo commented on GitHub (Jan 26, 2018): Hi, I don't think terminals provide us with that information. I'm using `tcell` to process key events. They give some information [here](https://godoc.org/github.com/gdamore/tcell#EventKey): > For example, if the rune is 'A', this will be reported without the ModShift bit set, since really can't tell if the Shift key was pressed (it might have been CAPSLOCK, or a terminal that only can send capitals, or keyboard with separate capital letters from lower case letters). > > Generally, terminal applications have far less visibility into keyboard activity than graphical applications. Hence, they should avoid depending overly much on availability of modifiers, or the availability of any specific keys. So I'm afraid you won't be able to listen to Shift key events.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#33
No description provided.