keyhook.c
branchgtkui
changeset 45 cf6a06f368e6
parent 17 e884dbb403cc
child 48 5b2b972c5078
equal deleted inserted replaced
44:2150bce729df 45:cf6a06f368e6
     1 // !!! FIXME: this is X11 specific.  :(
     1 // !!! FIXME: this is X11 specific.  :(
     2 
     2 
     3 #include <stdio.h>
     3 #include <stdio.h>
       
     4 
       
     5 #if 1
     4 #include <stdlib.h>
     6 #include <stdlib.h>
     5 #include <string.h>
     7 #include <string.h>
     6 #include <pthread.h>
     8 #include <pthread.h>
     7 #include <unistd.h>
     9 #include <unistd.h>
     8 
    10 
   128     sawKeyCombo = 0;
   130     sawKeyCombo = 0;
   129     XRecordProcessReplies(datadpy);
   131     XRecordProcessReplies(datadpy);
   130     return sawKeyCombo;
   132     return sawKeyCombo;
   131 } // pumpKeyHook
   133 } // pumpKeyHook
   132 
   134 
       
   135 #else
       
   136 
       
   137 int initKeyHook(void) { return 1; }
       
   138 void deinitKeyHook(void) {}
       
   139 
       
   140 int pumpKeyHook(void)
       
   141 {
       
   142 static int x = 50;
       
   143 const int retval = (x == 50);
       
   144 if (++x > 50) x = 0;
       
   145 if (retval) printf("fire it!\n");
       
   146 return retval;
       
   147 }
       
   148 
       
   149 #endif
       
   150 
   133 // end of keyhook.c ...
   151 // end of keyhook.c ...
   134 
   152