Skip to contentSkip to conversation

tty/sysrq: More intuitive Shift handling

PATCH In review Oskari Pirhonen 3 participants 4 messages Sep 26, 2021 – Oct 1, 2021 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty/sysrq: More intuitive Shift handling

Make Alt-SysRq-Shift-<key> behave like Alt-Shift-SysRq-<key>.

---
 drivers/tty/sysrq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/sysrq.c +2 -0
index c911196ac893..4d3dbe62daf8 100644
@@ -843,6 +843,8 @@ static bool sysrq_handle_keypress(struct sysrq_state *sysrq,
 			sysrq->shift = KEY_RESERVED;
 		else if (value != 2)
 			sysrq->shift = code;
+		if (sysrq->active)
+			sysrq->shift_use = sysrq->shift;
 		break;
 
 	case KEY_SYSRQ:
Signature · 1 line
2.32.0
#1 lore raw
Quoted 1 line · Oskari Pirhonen

Make Alt-SysRq-Shift-<key> behave like Alt-Shift-SysRq-<key>.

Does some documentation also need to be updated here?

#2 lore raw
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line · Oskari Pirhonen

Make Alt-SysRq-Shift-<key> behave like Alt-Shift-SysRq-<key>.

Does some documentation also need to be updated here?

There wasn't any documentation about it to begin with which lead to the patch in the first place. Documentation/admin-guide/sysrq.rst only says this about it:

Quoted 9 lines

How do I use the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On x86
You press the key combo :kbd:ALT-SysRq-<command key>.

... snip ...

The :kbd:<command key> is case sensitive.

I couldn't figure out why an event I had registered onto a capital key wasn't being triggered until a friend told me that I needed to press Alt-Shift-SysRq-<key>. AFAICT, the only place that the proper keystroke is even mentioned is in the commit message for a27eb0cb4b21:

Quoted 2 lines

For already existing SysRq operations the user presses Alt-SysRq-<key>, and for the newly added ones Alt-Shift-SysRq-<key>.

If you think adding to the documentation is useful then I can submit a v2. Although I believe that this patch makes it redundant since "case sensitive" implies Shift, and for many people, the natural place to hit the Shift key is likely to be right before the relevant <key>.

- Oskari