Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 230569
Collapse All | Expand All

(-)revoco.c (-53 / +6 lines)
Lines 4-9 Link Here
4
 * Requires hiddev.
4
 * Requires hiddev.
5
 *
5
 *
6
 * Written November 2006 by E. Toernig's bonobo - no copyrights.
6
 * Written November 2006 by E. Toernig's bonobo - no copyrights.
7
 * Cleanup by Petteri Räty <betelgeuse@gentoo.org> and adapted to 0.4 by evadim <evadim@evadim.ru>
7
 *
8
 *
8
 * Contact: Edgar Toernig <froese@gmx.de>
9
 * Contact: Edgar Toernig <froese@gmx.de>
9
 *
10
 *
Lines 47-52 Link Here
47
#include <stdlib.h>
48
#include <stdlib.h>
48
#include <unistd.h>
49
#include <unistd.h>
49
#include <sys/ioctl.h>
50
#include <sys/ioctl.h>
51
// hiddev and the headers it requires
52
#include <asm/types.h>
53
#include <linux/hiddev.h>
50
54
51
#define streq(a,b)	(strcmp((a), (b)) == 0)
55
#define streq(a,b)	(strcmp((a), (b)) == 0)
52
#define strneq(a,b,c)	(strncmp((a), (b), (c)) == 0)
56
#define strneq(a,b,c)	(strncmp((a), (b), (c)) == 0)
Lines 55-111 Link Here
55
#define MX_REVOLUTION	0xc51a	// version RR41.01_B0025
59
#define MX_REVOLUTION	0xc51a	// version RR41.01_B0025
56
#define MX_REVOLUTION2	0xc525	// version RQR02.00_B0020
60
#define MX_REVOLUTION2	0xc525	// version RQR02.00_B0020
57
61
58
/*** extracted from hiddev.h ***/
59
60
typedef signed short s16;
61
typedef signed int s32;
62
typedef unsigned int u32;
63
64
struct hiddev_devinfo {
65
	u32 bustype;
66
	u32 busnum;
67
	u32 devnum;
68
	u32 ifnum;
69
	s16 vendor;
70
	s16 product;
71
	s16 version;
72
	u32 num_applications;
73
};
74
75
struct hiddev_report_info {
76
	u32 report_type;
77
	u32 report_id;
78
	u32 num_fields;
79
};
80
81
#define HID_REPORT_TYPE_INPUT	1
82
#define HID_REPORT_TYPE_OUTPUT	2
83
#define HID_REPORT_TYPE_FEATURE	3
84
85
struct hiddev_usage_ref {
86
	u32 report_type;
87
	u32 report_id;
88
	u32 field_index;
89
	u32 usage_index;
90
	u32 usage_code;
91
	s32 value;
92
};
93
94
struct hiddev_usage_ref_multi {
95
	struct hiddev_usage_ref uref;
96
	u32 num_values;
97
	s32 values[1024];
98
};
99
100
#define HIDIOCGDEVINFO		_IOR('H', 0x03, struct hiddev_devinfo)
101
#define HIDIOCGREPORT		_IOW('H', 0x07, struct hiddev_report_info)
102
#define HIDIOCSREPORT		_IOW('H', 0x08, struct hiddev_report_info)
103
#define HIDIOCGUSAGES		_IOWR('H', 0x13, struct hiddev_usage_ref_multi)
104
#define HIDIOCSUSAGES		_IOW('H', 0x14, struct hiddev_usage_ref_multi)
105
106
/*** end hiddev.h ***/
107
108
109
static void
62
static void
110
fatal(const char *fmt, ...)
63
fatal(const char *fmt, ...)
111
{
64
{
Lines 337-344 Link Here
337
static void
290
static void
338
usage(void)
291
usage(void)
339
{
292
{
340
    printf("Revoco v"VERSION" - Change the wheel behaviour of "
293
    printf("Revoco v%.1f - Change the wheel behaviour of "
341
				    "Logitech's MX-Revolution mouse.\n\n");
294
                                   "Logitech's MX-Revolution mouse.\n\n", VERSION);
342
    printf("Usage:\n");
295
    printf("Usage:\n");
343
    printf("  revoco free                      free spinning mode\n");
296
    printf("  revoco free                      free spinning mode\n");
344
    printf("  revoco click                     click-to-click mode\n");
297
    printf("  revoco click                     click-to-click mode\n");

Return to bug 230569