I have recently been feeling RSI setting in (I have had it before).
I have been paying attention to what effects my hands and the right hand bending out to press the backspace and return keys seem to be causing a lot of the problem.
I have defined "M-d" to backwards delete, which works fine, and I know about "C-m" entering a newline but I still keep involuntarily pressing the actual keys so I want to disable them in emacs.
I tried this:
(global-unset-key "\r")
But this breaks "C-m" as well So I added this line:
(global-set-key "\C-m" 'newline)
But that restores the return key as well.
Please show me how to unbind just the return and backspace keys whilst maintaining the other bindings
Setting return and backspace to do nothing should work. That is, these two lines should suffice:
(global-set-key (kbd "<return>") 'ignore)
(global-set-key (kbd "<backspace>") 'ignore)
This will leave keystrokes like C-m
operational.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With