[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ctrl-/ interpreted as Backspace in text console



On Sun, Mar 11, 2012 at 00:56:12 +0800, Liu Binsheng wrote:
> Hi,
> 
> When I press Ctrl-/ in the text console, it deletes a char like
> backspace. But if I use Gnome and press Ctrl-/ in gnome-terminal,
> Ctrl-/ behaves normally.

 [...]

> Here's the results of running `showkey -a` in text console:
> 
> Press any keys - Ctrl-D will terminate this program
> 
> ^? 	127 0177 0x7f		> when pressing Ctrl-/
> ^? 	127 0177 0x7f		> when pressing Backspace
> / 	 47 0057 0x2f		> when pressing /
> ? 	 63 0077 0x3f		> when pressing ?
> ^D 	  4 0004 0x04		> Ctrl-D
> 
> The results of running `showkey -a` in gnome-terminal:
> 
> Press any keys - Ctrl-D will terminate this program
> 
> ^_ 	 31 0037 0x1f		> when pressing Ctrl-/. result differs
> ^? 	127 0177 0x7f		> when pressing Backspace
> / 	 47 0057 0x2f		> when pressing /
> ? 	 63 0077 0x3f		> when pressing ?
> ^D 	  4 0004 0x04		> Ctrl-D
> 
> This problem is very annoying because I bind Ctrl-/ to undo in
> emacs. Could you please provide any suggestions to make Ctrl-/ not
> behave like backspace?

You can try

  echo "control keycode 53 = Control_underscore" | loadkeys

as root to assign keysymbol 0x1f to the Ctrl-/ combination on the text
console, assuming that / has keycode 53 on your system, which you can
verify with "showkey -k".

I have no idea how this modification interacts with emacs, but it should
ensure the same behavior on text consoles as in gnome terminal, which
seems to be what you want to achieve if I understand you correctly.

-- 
Regards,            |
          Florian   | http://www.florian-kulzer.eu


Reply to: