I bought my laptop in 2009. And I am using it (overusing it) ever since. When I joined Sixdee Telecoms in 2012, they gave me another laptop. For the next six months I was using (overusing) the new one, and I kept my old buddy in a blue HP bag – without touching it. In August 2013 I left Sixdee. and my laptop came out of the blue bag. And after two – three months the keyboard started to misbehave. some keys like Escape, Backspace & Enter stopped working. The only option I had, was to buy a usb-keyboard. and I did it. I bought a small usb-keyboard for Rs 250/-. ans started using it.
After one month – when I visited Jithinettan, he was also facing the same issue – almost all keys of his laptop were not working. So he bought a usb-keyboard and some of the keys in the usb-keyboard also stopped working. And he was using on-screen keyboard for typing those keys. I stayed with him for a few weeks.
On a not-so-special morning when I woke up , my laptop keys started working. I don’t know how, but they started working. all keys – at the same time. For a moment I thought about spreading the news.I imagined about the hundreds of curiosity-seekers, attracted by the resounding news of the miracle. But after considering the fact that I had only one laptop, I changed my mind.
I gave my usb-keyboard to Jithinettan and after a few days I came back to Ernakulam. Life was better without a usb-keyboard. Months flew like days. One day I was chatting with someone and suddenly the chat-window got closed. I opened it again and it got closed again within no seconds. After sometime when I opened the Gmail compose window, the same thing happened. I restarted my machine and everything was fine. I heard the voice of Morpheus -“It must be a glitch in the matrix“.
Similar incidents started to occur for the next few days. And it was VIM, who showed me the culprit. It was ‘the escape key’. the escape key was being pressed for no reason. I tried cleaning the keyboard. I tried almost everything – without any luck. And one day I got angry and I attacked the escape key with all my force. I caught the key with my nails and I pulled with complete energy – and I won. They key was in my hand, a white round thing was all that remained in the position of the escape key. I restarted the machine and tried using it. Now the unwanted escape key press was not happening. Whenever I needed the escape key I pressed on the white spot – and the escape key press event got triggered. I smiled. – That was a big victory.
Exactly after two days, the glitch happened again. the escape key was being pressed again. And there was nothing left on the position of escape key. I considered firing an XMP-Burstor. But there were no portals on that position. So instead of using the ingress app I tried to scan the position using the ‘xev‘ command. – and yess!! – the escape key was being pressed. To be exact, the key with keycode 9 was being pressed. “Why don’t you remap the keys?” – it was Morpheus again. “Why don’t you remap the keys?” I asked myself.
For remapping the keys I should find out a key which I don’t use. After spending a couple of minutes, I found the key – the menu key (right click key). This is the only key which I can live without. So the game is ON.
Step 1: Disable keycode 9
xmodmap -e ‘keycode 9 = NoSymbol’
I used this commend for disabling the usual escape key. After running this command, I tried pressing the white spot. nothing is happening. I again used xev to confirm this. Yes – the key is being pressed and nothing is happening because it is mapped to NoSymbol. All is clear and we are ready to move to the next step.
Step 2: Remap the menu key into escape key
xmodmap -e ‘keycode 135 = Escape’
The keycode of the menu key is 135. We just mapped the key with keycode 135 into Escape action. I tried pressing it. It works in VIM , chat windows are getting closed when I press the menu key. and I confirmed it using the xev command.
YESS!! I did it. I neutralized the escape key ( keycode9). And life is beautiful again..But if this happens again with a new key – I don’t have any spare keys