Page MenuHomeFreeBSD

Allow enable/disable some keyboard combinations.

Authored by ray on Sep 9 2014, 2:22 PM.



Add sysctls to allow enable/disable some keyboard combinations.

Diff Detail

rS FreeBSD src repository
No Linters Available
No Unit Test Coverage

Event Timeline

ray updated this revision to Diff 1417.Sep 9 2014, 2:22 PM
ray retitled this revision from to Allow enable/disable some keyboard combinations..
ray updated this object.
ray edited the test plan for this revision. (Show Details)
ray added reviewers: emaste, jhb, dumbbell.
dumbbell edited edge metadata.Sep 9 2014, 2:25 PM

What are these key combinations? Does it have something to do with Ctrl+Alt+Esc in syscons to break into ddb?

emaste added inline comments.Sep 9 2014, 2:30 PM

underscore not needed in description


"Enable debugger keyboard combination"?


strange whitespace?

emaste edited edge metadata.Sep 9 2014, 2:33 PM

What are these key combinations?

Yes, the key map converts a few combinations into halt / reboot / debugger etc. "keys" -- see halt/pdwn/debug/susp/saver/panic in kbdmap(5)

See inline comments.

Also, where are those key combinations documented? Are they configurable? If not, it may be helpful to have them in the sysctl description.


I know that syscons used the same call, but you may use the RB_AUTOBOOT flag instead of 0.

emaste added a comment.EditedSep 9 2014, 4:07 PM

They are configurable by a keymap, meaning we'd need something like

"Enable key combination to enter debugger (typically Ctrl-Alt-Esc)"

(or "by default" etc.)

Yeah, I think that this description helps. For instance, I don't know the combinations for reboot/halt/poweroff :) I thought Ctrl-Alt-Del was handled by init(8) but I may be wrong and simply confuse with Linux.

Regarding the text, I like your second suggestion, "... (by default, Ctrl-Alt-Esc)".

ray updated this revision to Diff 1428.Sep 9 2014, 10:15 PM
ray edited edge metadata.

o Extend descriptions for reboot and debug.

ray added a comment.Sep 9 2014, 10:18 PM

how is it looks now? :)


Same as debug case, it is combination name. so not "power off", but something like "Power-Off"


I like "Enable \"Enter DDB\" keyboard combination" more. If it applicable :)


Hmmm, where is it?

dumbbell added inline comments.Sep 10 2014, 7:14 AM

You forgot to change power_off to power off (no underscore).

What are the combinations for the two actions above?


So Ctrl-Alt-Delete is really the key combination for that action?

ray updated this revision to Diff 1435.Sep 10 2014, 10:37 AM

Lets look it from other point of view:
o Implement all special combinations that syscons(4) have.
o Point to kbdmap(5) for reference.

ray added a comment.Sep 10 2014, 10:39 AM

btw, anybody know where to get scancodes without making experiments? :)

dumbbell accepted this revision.Sep 10 2014, 10:58 AM
dumbbell edited edge metadata.
dumbbell added inline comments.

Thanks, the description is way more helpful like this.

Just a minor comment: I would move the "(typically ...)" brackets after the "See kbdmap(5)" but before the final ".":

​VT_SYSCTL_INT(kbd_reboot, 1, "Enable reboot keyboard combination. "
 "See kbdmap(5) to configure (typically Ctrl-Alt-Delete).");

And don't mix single-space and double-space after a ".".

This revision is now accepted and ready to land.Sep 10 2014, 10:58 AM

Oh and no, I don't know an official list of scancodes :)

ray closed this revision.Sep 10 2014, 12:40 PM

Committed as r271381.
Thank you guys!


ok, get it. And fixed.
Will commit it (changes not so critical to wait all reviewers :) )