Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Why is Pause/Break key is immediately released? Can that be fixed?

Post

Why is Pause/Break key is immediately released? Can that be fixed?

+6
−0

Since the Pause key is useless, I tried to map it to a modifier key. What is straightforward for other keys turned out not to work fine for Pause.

By inspecting the output of xev -event keyboard | grep -E '^Key|state' for holding Pause and then pressing s,

KeyPress event, serial 28, synthetic NO, window 0x800001,
    state 0x0, keycode 127 (keysym 0xffed, Hyper_L), same_screen YES,

KeyRelease event, serial 28, synthetic NO, window 0x800001,
    state 0x20, keycode 127 (keysym 0xffed, Hyper_L), same_screen YES,

KeyPress event, serial 28, synthetic NO, window 0x800001,
    state 0x0, keycode 39 (keysym 0x73, s), same_screen YES,

KeyRelease event, serial 28, synthetic NO, window 0x800001,
    state 0x0, keycode 39 (keysym 0x73, s), same_screen YES,

we see that I succeeded in making Pause an Hyper modifier; However, it can't actually be used as a modifier since the key is immediately released (even though I didn't release it before pressing s).

The same is detected by showkey: Holding Pause immediately outputs

keycode 119 press
keycode 119 release

whereas holding another key (Insert) spams

keycode 110 press
keycode 110 press
keycode 110 press
keycode 110 press
keycode 110 press

as expected.

Why does this odd behavior happen with the Pause key? Is it a hardware thing (and thus unsolvable) or can it be addressed in the OS level?

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

It must be a software thing (unless you are using some programmable keyboard) (5 comments)
Not what I'm seeing (4 comments)
It must be a software thing (unless you are using some programmable keyboard)
elgonzo‭ wrote over 2 years ago · edited over 2 years ago

With respect to the hardware and the USB HID protocol (i am assuming you are using a USB keyboard), the PAUSE key is no different than any other key on the keyboard (except the modifier keys), with the keyboard just sending the scan code of the respective keys being pressed/hold down at the moment the keyboard is being polled/scanned. (Scan codes are not the same as key codes. Scan codes are what the HW deals with, and loosely correlate with the location of a key on the keyboard regardless of what symbol is printed on a key cap -- rare-ish exceptions not withstanding --, whereas key codes are what the scan codes are translated into by the OS.) I have no experience with low-level keyboard tinkering in Linux, but perhaps look for a way to map scan codes instead of key codes. And for the same reason i can't say if the specific PAUSE key behavior you observe is due to the kernel/OS, or the result of some other software component or a quirk of the key mapping software itself... :-(

Quasímodo‭ wrote over 2 years ago

elgonzo‭ I use my laptop's keyboard — but since I read that touchpads may be USB or PS/2, I reckon a laptop's keyboard might also be so?

elgonzo‭ wrote over 2 years ago · edited about 2 years ago

Yes, in most cases the keyboard is either connected by an (internal) PS/2 interface for old(er) laptops, or USB for modern-ish laptops. Seldomly -- if at all - you will find a laptop that uses a different interface for its integrated keyboard, simply because that would demand from the manufacturer to add yet another controller IC to the BOM and to provide matching (custom) drivers for the supported OS's.

(Just to make clear: I am NOT talking about how the physical keyboard module is electrically connected with the laptop's circuit board, but about the keyboard interface to the chipset/CPU. If the keyboard controller were to sit on the laptop circuit board, the electrical connection between keyboard module and circuit board is entirely defined by how the concrete keyboard controller chip being used wants/needs to be connected with the key matrix, something that is entirely unrelated to how the keyboard controller interfaces with the CPU/chipset.)

Quasímodo‭ wrote about 2 years ago

elgonzo‭ You might want to see the edited answer. Unfortunately I could not find a way to determine the PS/2 mode of my keyboard.

elgonzo‭ wrote about 2 years ago

Quasímodo‭ i found very little about PS/2 mode 3 aside from a few forum posts talking about old terminal / workstation keyboards. Wich leads me to believe that PS/2 mode 3 was/is an protocol not used in standard PCs, although i am not 100% certain due to not being able to find any authoritative documentation about this mode. :-(