0

I'm looking for a tool that will tell me what my keyboard is sending to the operating system when i push different keys.

This is to help me answer this question How to get Cmd-left/right working with iTerm2 and Vim (without requiring .vimrc changes)? which has me trying to figure out why Vim treats my iTerm2 mapping of Cmd-left to Escape-[H differently from Home.

I tried unix's read, and it says that Home and Cmd-left both produce "^[[H". I'm hoping that read is misleading me, and that some other tool will show how Home and Cmd-left are different (note: when I say, Cmd-left in this paragraph, it is when iTerm2's mapping is turned on).

Thanks!

Community
  • 1
  • 1
Dolan Antenucci
  • 15,432
  • 17
  • 74
  • 100
  • Would be helpful if downvoters would explain why I'm being downvoted. The question is clearly different from my other question. – Dolan Antenucci Mar 08 '12 at 00:22
  • 1
    "keyboard" has very different meaning under X11 and in raw console (without any graphical desktop). You could be interested in using `xev` on Linux (or other X11 environment). – Basile Starynkevitch Mar 08 '12 at 08:23

1 Answers1

1

You're doing all this in a terminal, right?

I'm afraid you're not going to do much better than read (my preferred approach is to do cat > file, type, press ^D, and then look at the file in a hex editor).

With regard to the underlying question, it's worth hunting for options in your terminal emulator. Right now it's emulating a terminal which doesn't distinguish between HOME and CMD+LEFT. It may be possible to tell it to emulate a different terminal, which does.

David Given
  • 13,277
  • 9
  • 76
  • 123