inputstat 0.1.2

a vmstat-like tool which monitors keyboard and mouse events
Documentation
  • Coverage
  • 63.64%
    7 out of 11 items documented0 out of 10 items with examples
  • Size
  • Source code size: 9.63 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • sugarfillet/inputstat
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sugarfillet

inputstat

What is it

inputstat is a vmstat-like tool which monitors keyboard and mouse events on linux. in detail, collects and reports the activity statistics of keyboard and mouse. And it is written by rust.

Demo

 

$ sudo inputstat -k /dev/input/event5 -m /dev/input/event6 5  # print every 5 seconds 
>>  summary counts 14676 ## keyboard counts 9460 ## mouse counts 5216
>>  KEY_BACKSPACE -> 1181 ##  KEY_SPACE -> 719 ##  KEY_J -> 432 ##  KEY_LEFTCTRL -> 402 ##  KEY_I -> 376 ## 
>>  WHEEL -> 3401 ##  BTN_LEFT -> 1778 ##  BTN_RIGHT -> 30 ##  BTN_MIDDLE -> 7 ## 

>>  summary counts 14676 ## keyboard counts 9460 ## mouse counts 5216
>>  KEY_BACKSPACE -> 1181 ##  KEY_SPACE -> 719 ##  KEY_J -> 432 ##  KEY_LEFTCTRL -> 402 ##  KEY_I -> 376 ## 
>>  WHEEL -> 3401 ##  BTN_LEFT -> 1778 ##  BTN_RIGHT -> 30 ##  BTN_MIDDLE -> 7 ## 


Install

cargo install inputstat

How it works

  1. directly communicate with event device , the userspace interface of input subsystem
  2. architecture of this program
   k_thread  m_thread    collect_thread          display_thread 
   |______|____mpsc_____7              \_____Arc______|