]> git.gir.st - tmk_keyboard.git/blob - report.h
fixed a bug on host_system_send().
[tmk_keyboard.git] / report.h
1 /*
2 Copyright 2011 Jun Wako <wakojun@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef REPORT_H
19 #define REPORT_H
20
21 #include <stdint.h>
22
23
24 /* report id */
25 #define REPORT_ID_MOUSE 1
26 #define REPORT_ID_SYSTEM 2
27 #define REPORT_ID_CONSUMER 3
28
29 /* mouse buttons */
30 #define MOUSE_BTN1 (1<<0)
31 #define MOUSE_BTN2 (1<<1)
32 #define MOUSE_BTN3 (1<<2)
33 #define MOUSE_BTN4 (1<<3)
34 #define MOUSE_BTN5 (1<<4)
35
36 // Consumer Page(0x0C)
37 // following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx
38 #define AUDIO_MUTE 0x00E2
39 #define AUDIO_VOL_UP 0x00E9
40 #define AUDIO_VOL_DOWN 0x00EA
41 #define TRANSPORT_NEXT_TRACK 0x00B5
42 #define TRANSPORT_PREV_TRACK 0x00B6
43 #define TRANSPORT_STOP 0x00B7
44 #define TRANSPORT_PLAY_PAUSE 0x00CD
45 #define AL_CC_CONFIG 0x0183
46 #define AL_EMAIL 0x018A
47 #define AL_CALCULATOR 0x0192
48 #define AL_LOCAL_BROWSER 0x0194
49 #define AC_SEARCH 0x0221
50 #define AC_HOME 0x0223
51 #define AC_BACK 0x0224
52 #define AC_FORWARD 0x0225
53 #define AC_STOP 0x0226
54 #define AC_REFRESH 0x0227
55 #define AC_BOOKMARKS 0x022A
56 // supplement for Bluegiga iWRAP HID(not supported by Windows?)
57 #define AL_LOCK 0x019E
58 #define TRANSPORT_RECORD 0x00B2
59 #define TRANSPORT_REWIND 0x00B4
60 #define TRANSPORT_EJECT 0x00B8
61 #define AC_MINIMIZE 0x0206
62
63 // Generic Desktop Page(0x01)
64 #define SYSTEM_POWER_DOWN 0x0081
65 #define SYSTEM_SLEEP 0x0082
66 #define SYSTEM_WAKE_UP 0x0083
67
68
69 // key report size(NKRO or boot mode)
70 #if defined(HOST_PJRC)
71 # include "usb.h"
72 # if defined(KBD2_REPORT_KEYS) && KBD2_REPORT_KEYS > KBD_REPORT_KEYS
73 # define REPORT_KEYS KBD2_REPORT_KEYS
74 # else
75 # define REPORT_KEYS KBD_REPORT_KEYS
76 # endif
77 #else
78 # define REPORT_KEYS 6
79 #endif
80
81 typedef struct {
82 uint8_t mods;
83 uint8_t rserved;
84 uint8_t keys[REPORT_KEYS];
85 } report_keyboard_t;
86
87 typedef struct {
88 uint8_t report_id;
89 uint8_t buttons;
90 int8_t x;
91 int8_t y;
92 int8_t v;
93 int8_t h;
94 } report_mouse_t;
95
96 #endif
Imprint / Impressum