1

First of all sorry my punctuation will be bad. its hard to type when keys are not doing what you expect. Eg it keeps scaring the **** out of me by taking a screen shot when I push the up arrow lolol

So anyways, I broke a key on my keyboard and used xkeycaps to remap it to an unused key which worked. But then I realized it screwed up other keys...

I think this is the program I used http://www.jwz.org/xkeycaps/man.html

And then after doing the modifications I found out how to save them from the second answer in this question How to Map my enter key to a different key down where it says this "When you are happy with your current keymap and want to use it in future X-sessions, run the following command to save it:

xmodmap -pke > ~/.Xmodmap"

I doubt this is relevant but I just restarted with a live cd and the keys all worked there. well it's kind of relevant because it verifies what I was thinking... worst case scenario I can format and reinstall and the issue will go away.

5
  • Which key did you remap it? Aug 22, 2014 at 22:31
  • I was just switching the semicolon (this is the broken one I still can't type) with the f12 key which worked ;;;; (I'm pushing f12) ;;; lol
    – user273872
    Aug 22, 2014 at 23:03
  • I tried using xev to figure out the key code for the up arrow which is apparently 111 then I used this command xmodmap -e "keycode 111 = Up" and tested it and it still doesnt work
    – user273872
    Aug 22, 2014 at 23:27
  • Did you try removing (or moving or renaming) the ~/.Xmodmap file and restarting?
    – muru
    Aug 23, 2014 at 0:03
  • How would I go about finding that file?
    – user273872
    Aug 23, 2014 at 1:04

1 Answer 1

2


According to this answer "xmodmap has no notion of state, so it has no way to reset state directly."

So, you can restore it to back by undoing your edited keys:

Open terminal again and type this line one by one for key: for example to set the ; and F12 as default do following command.

xmodmap -e "keycode 47 = semicolon"
xmodmap -e "keycode 96 = F12"

Next type xmodmap -pke > ~/.Xmodmap

Or you can use setxkbmap -layout Your_keybard_Layout_Here to reset completely your changes to default.

Note:
Replace correct keyboard layout istead of Your_keybard_Layout_Here use setxkbmap -query to find your correct layout.

For example my layout is "us":

user@test-pc:~$ setxkbmap -query
   rules:      evdev
   model:      pc105
   layout:     us        <---------------------- HERE
   options:    grp_led:scroll
3
  • I don't care if those two stay swapped. Even if I get this reset I will try to swap those two again. It's all the other keys that got remapped with out me trying to remap them that are the problem, and now they won't map to anything...
    – user273872
    Aug 22, 2014 at 23:35
  • @user273872 I have updated my answer. check please. Aug 23, 2014 at 6:00
  • seems legit... I have reformatted a couple of times since then so idk...
    – user273872
    Sep 22, 2014 at 4:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .