aboutsummaryrefslogtreecommitdiff
path: root/common/report.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-12-16 02:32:07 +0900
committertmk <nobody@nowhere>2012-12-16 02:32:07 +0900
commit8a709c2750eab09ec0f83450410a13640931d48e (patch)
tree224bcea716521704d63993ed54917152a6bf046e /common/report.h
parent77f157943f4e083fb9f1eaa0a55078b128842458 (diff)
downloadqmk_firmware-8a709c2750eab09ec0f83450410a13640931d48e.tar.gz
qmk_firmware-8a709c2750eab09ec0f83450410a13640931d48e.zip
Add initial fix for new keymap.
Diffstat (limited to 'common/report.h')
-rw-r--r--common/report.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/common/report.h b/common/report.h
index a73e0aba1..e8582d81f 100644
--- a/common/report.h
+++ b/common/report.h
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19#define REPORT_H 19#define REPORT_H
20 20
21#include <stdint.h> 21#include <stdint.h>
22#include <keycode.h>
22 23
23 24
24/* report id */ 25/* report id */
@@ -97,6 +98,86 @@ typedef struct {
97 int8_t h; 98 int8_t h;
98} __attribute__ ((packed)) report_mouse_t; 99} __attribute__ ((packed)) report_mouse_t;
99 100
101
102static uint16_t key2system(uint8_t key)
103{
104 uint16_t usage = 0;
105 switch (key) {
106 case KC_SYSTEM_POWER:
107 usage = SYSTEM_POWER_DOWN;
108 break;
109 case KC_SYSTEM_SLEEP:
110 usage = SYSTEM_SLEEP;
111 break;
112 case KC_SYSTEM_WAKE:
113 usage = SYSTEM_WAKE_UP;
114 break;
115 }
116 return usage;
117}
118
119static uint16_t key2consumer(uint8_t key)
120{
121 uint16_t usage = 0;
122 switch (key) {
123 case KC_AUDIO_MUTE:
124 usage = AUDIO_MUTE;
125 break;
126 case KC_AUDIO_VOL_UP:
127 usage = AUDIO_VOL_UP;
128 break;
129 case KC_AUDIO_VOL_DOWN:
130 usage = AUDIO_VOL_DOWN;
131 break;
132 case KC_MEDIA_NEXT_TRACK:
133 usage = TRANSPORT_NEXT_TRACK;
134 break;
135 case KC_MEDIA_PREV_TRACK:
136 usage = TRANSPORT_PREV_TRACK;
137 break;
138 case KC_MEDIA_STOP:
139 usage = TRANSPORT_STOP;
140 break;
141 case KC_MEDIA_PLAY_PAUSE:
142 usage = TRANSPORT_PLAY_PAUSE;
143 break;
144 case KC_MEDIA_SELECT:
145 usage = AL_CC_CONFIG;
146 break;
147 case KC_MAIL:
148 usage = AL_EMAIL;
149 break;
150 case KC_CALCULATOR:
151 usage = AL_CALCULATOR;
152 break;
153 case KC_MY_COMPUTER:
154 usage = AL_LOCAL_BROWSER;
155 break;
156 case KC_WWW_SEARCH:
157 usage = AC_SEARCH;
158 break;
159 case KC_WWW_HOME:
160 usage = AC_HOME;
161 break;
162 case KC_WWW_BACK:
163 usage = AC_BACK;
164 break;
165 case KC_WWW_FORWARD:
166 usage = AC_FORWARD;
167 break;
168 case KC_WWW_STOP:
169 usage = AC_STOP;
170 break;
171 case KC_WWW_REFRESH:
172 usage = AC_REFRESH;
173 break;
174 case KC_WWW_FAVORITES:
175 usage = AC_BOOKMARKS;
176 break;
177 }
178 return usage;
179}
180
100#ifdef __cplusplus 181#ifdef __cplusplus
101} 182}
102#endif 183#endif