summaryrefslogtreecommitdiff
path: root/comm-keyboard.c
blob: 21ec0e6899f2bc91a644cbb157921996f396c4a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//File:       comm-keyboard.c
//Written by: Mark Rader
//Version:    1.0
//Date:       Sun Jan 11 2009
//Copyright (c) 2009 by Mark Rader.  
// $Log$
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// $Log$
//

#ifndef lint
static char *rcsid = "$Header$";
#endif

#include "comm-keyboard.h"
#include "lxevent.h"


void process_keystroke(key_message kmessage){
  FILE *fileno;
  switch (kmessage.commandID){
  case NITPICKER_KEYPRESS_DOWN:

    //  printf("%d Key down\n",kmessage.key);
    if ((fileno = fopen("/keydown_point.txt","a+")) == NULL) {
	    printf("file not opend");
      } else {
	fprintf(fileno,"%d is the char code\n", kmessage.key);
	fclose(fileno);
      }
    button_event_callback(1,kmessage.key);

    break;
  case NITPICKER_KEYPRESS_UP:

    //printf("%d Key up\n",kmessage.key);
    if ((fileno = fopen("/keyup_point.txt","a+")) == NULL) {
	    printf("file not opend");
      } else {
	fprintf(fileno,"%d is the char code\n", kmessage.key);
	fclose(fileno);
      }
    button_event_callback(0,kmessage.key);

    break;

  default:

    break;
  }

  return;
}