Getting logged out when pressing the PrintScreen key

I just installed 14.0 on my laptop, using it without any gui for now. The problem is that whenever I (accidentally) hit the PrintScreen key, I get immediately logged out.

On a normal keyboard this wouldn't be much of a problem because of the layout. But on my laptop, the PrintScreen key is sitting right next to the right Control and the arrow keys, so it happens quite a lot...

How can I unmap (or remap) this key? I'm using csh by default.
 
You're not logged out, the printscreen button switches to the next virtual console. Just note how the terminal switches from ttyv0 to ttyv1, ttyv2, etc. You can switch back to the first console by repeatedly pressing printscreen (it will just loop over the available virtual consoles), or with <ctrl>-F1, <ctrl>-F2, etc.
 
Ah! Thank you SirDice!

I didn't notice the switch to the next tty. Is there a way to bind that to a different key that PrintScreen?
 
[…] How can I unmap (or remap) this key? […]
First, dump the currently loaded keyboard layout, kbdcontrol(1). ⌨️
Bash:
kbdcontrol -d > ./kbdmap
Then install misc/kbdscan and identify the key code associated with the key labeled Prt Sc or similar. 🖨️
Bash:
kbdscan # Hit Enter, and then tap the print screen key.
Finally edit the kbdmap(5) with your favorite editor (or ee(1)) and load the keyboard layout. 🚢
Bash:
kbdcontrol -l ./kbdmap
You probably want to edit the /etc/rc.conf.local file defining a keymap rc.conf(5) value, too. 🎁
 
Thanks Kai Burghardt, this was bothering me for some time.

I'm using "de" keymap, for printing a pipe (vertical bar "|" ) I must press AltGr (left of PrtSc) and "< > |" key, on the left side, next to the left Shift key on the right. Many times I'm hitting the PrtSc key.

I've created /usr/local/share/vt/keymaps directories, placed the modified .kbd keymap there.

You probably want to edit the /etc/rc.conf.local file defining a keymap rc.conf(5) value, too.
Using here /etc/rc.conf
Code:
allscreens_kbdflags="-l /usr/local/share/vt/keymaps/de-noprtsc.kbd"

Theoretically one can place the modified .kbd under /usr/share/vt/keymaps and use the keymap variable in /etc/rc.conf, but I don't want to mix system files with user custom files.
 
[…] I don't want to mix system files with user custom files.
It’s not pointed out in the documentation but keymap can contain an absolute pathname. 👩‍💻 Take a look at the kbdcontrol_load_keymap function in /etc/rc.d/syscons. It just calls kbdcontrol(1) with the value of the keymap rc.conf(5) variable. The expansion of a value keymap='de-noprtsc.kbd' to /usr/share/vt/keymaps/de-noprtsc.kbd is done by kbdcontrol. 🔎 If the kbdmap(5) file can be found right away – as in the case of an absolute pathname – no further expansion occurs.​
 
It’s not pointed out in the documentation but keymap can contain an absolute pathname.
OK, good to know.

Thank you again.

Take a look at the kbdcontrol_load_keymap function in /etc/rc.d/syscons. It just calls kbdcontrol(1) with the value of the keymap rc.conf(5) variable. The expansion of a value keymap='de-noprtsc.kbd' to /usr/share/vt/keymaps/de-noprtsc.kbd is done by kbdcontrol. 🔎 If the kbdmap(5) file can be found right away – as in the case of an absolute pathname – no further expansion occurs.
I'm afraid my understanding of shell scripts is very limited. Even though pointing out to me where to look, I can't spot where the configuration happens.
 
Back
Top