Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I statistic my key press frequency and count

I am try to remap my keyboard to type better.

But I need to know the frequency of each key include symbol, It will be great if include tab shift ctrl. I need all the keypress acounting not only frequency of letters appears in english words.

I am using ibus-pinyin as my input method. and archlinux, awesome wm, without kde and gnome installed. any programes could help me?

BTW: what's wrong with dvorak. http://colemak.com/FAQ#What.27s_wrong_with_the_Dvorak_layout.3F

but colemak is not fit for me too, cause I want more synmbols.

but I have to keep some numbers, 1-5 to select chinese word from ibus, you know pinyin letters frequency is not same as english letters.

like image 530
guilin 桂林 Avatar asked Sep 30 '10 15:09

guilin 桂林


1 Answers

$ xwininfo

Now hit your terminal window with the mouse to obtain the window's id from the line like that:

xwininfo: Window id: 0x1e0000f "green"

Ask xev utility to track X events of your window, logging its output.

$ xev -id 0x1e0000f > log &

Type in some text and get your statistics from the log, filtering the keyreleases:

$ grep keysym log| sed -e "s/).*//" -e "s/.* //"| sort | uniq -c
      1 b
      2 c
      2 Control_L
      2 d
      1 e
      3 f
      3 g
      2 j
      1 k
      2 l
      1 n
      1 q
      1 r
      8 Return
      2 s
      1 t
      1 u
      1 v
      1 w
      1 y
      1 z
like image 71
horsh Avatar answered Sep 21 '22 00:09

horsh