SHARE
TWEET

Small C code to analyze Linux kernel input events

a guest Mar 2nd, 2016 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <linux/input.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main(int argc, char **argv) {
  6.  
  7.     FILE *fin;
  8.     struct input_event ie;
  9.     int i;
  10.    
  11.     fin = fopen ("dump.bin", "rb");
  12.    
  13.     while (fread(&ie, sizeof(struct input_event), 1, fin)) {
  14.    
  15.         printf ("Time: %d\tType: %d - Code: %d - Value: %d\n", (int)ie.time.tv_sec, ie.type, ie.code, ie.value);
  16.    
  17.     }
  18.    
  19.     fclose(fin);
  20.    
  21.     return 0;  
  22.  
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top