~tuomasjjrasanen/python-uinput/master

« back to all changes in this revision

Viewing changes to src/relcodesmodule.c

  • Committer: Tuomas Räsänen
  • Date: 2010-03-20 19:47:39 UTC
  • Revision ID: git-v1:2f0a0f9c83e895bc439e3d47038556834488e3d0
Major refactoring, much more granular and flexible interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  relcodes.c - Relative axis codes used in Linux input system
 
3
  Copyright (C) 2009 Tuomas Räsänen <tuos@codegrove.org>
 
4
 
 
5
  This library is free software; you can redistribute it and/or
 
6
  modify it under the terms of the GNU Lesser General Public
 
7
  License as published by the Free Software Foundation; either
 
8
  version 3 of the License, or (at your option) any later version.
 
9
 
 
10
  This library is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
  Lesser General Public License for more details.
 
14
 
 
15
  You should have received a copy of the GNU Lesser General Public
 
16
  License along with this library; if not, write to the Free Software
 
17
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
18
*/
 
19
 
 
20
#include <Python.h>
 
21
#include <linux/input.h>
 
22
 
 
23
static PyMethodDef relcodesMethods[] = {
 
24
        {NULL, NULL, 0, NULL}
 
25
};
 
26
 
 
27
PyMODINIT_FUNC initrelcodes(void)
 
28
{
 
29
        PyObject *module;
 
30
        module = Py_InitModule3("relcodes", relcodesMethods,
 
31
                                "Relative axis codes used in"
 
32
                                "Linux input system");
 
33
        PyModule_AddIntMacro(module, REL_X);
 
34
        PyModule_AddIntMacro(module, REL_Y);
 
35
        PyModule_AddIntMacro(module, REL_Z);
 
36
        PyModule_AddIntMacro(module, REL_RX);
 
37
        PyModule_AddIntMacro(module, REL_RY);
 
38
        PyModule_AddIntMacro(module, REL_RZ);
 
39
        PyModule_AddIntMacro(module, REL_HWHEEL);
 
40
        PyModule_AddIntMacro(module, REL_DIAL);
 
41
        PyModule_AddIntMacro(module, REL_WHEEL);
 
42
        PyModule_AddIntMacro(module, REL_MISC);
 
43
        PyModule_AddIntMacro(module, REL_MAX);
 
44
        PyModule_AddIntMacro(module, REL_CNT);
 
45
}