Skip to content

Commit 9be80c1

Browse files
authored
Shortcut Flags need to be adjusted as well
1 parent 640f2b1 commit 9be80c1

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

sunshine/input.cpp

+39-39
Original file line numberDiff line numberDiff line change
@@ -155,44 +155,6 @@ inline int apply_shortcut(short keyCode) {
155155
return 0;
156156
}
157157

158-
/**
159-
* Update flags for keyboard shortcut combo's
160-
*/
161-
inline void update_shortcutFlags(int *flags, short keyCode, bool release) {
162-
switch(keyCode) {
163-
case VKEY_SHIFT:
164-
case VKEY_LSHIFT:
165-
case VKEY_RSHIFT:
166-
if(release) {
167-
*flags &= ~input_t::SHIFT;
168-
}
169-
else {
170-
*flags |= input_t::SHIFT;
171-
}
172-
break;
173-
case VKEY_CONTROL:
174-
case VKEY_LCONTROL:
175-
case VKEY_RCONTROL:
176-
if(release) {
177-
*flags &= ~input_t::CTRL;
178-
}
179-
else {
180-
*flags |= input_t::CTRL;
181-
}
182-
break;
183-
case VKEY_MENU:
184-
case VKEY_LMENU:
185-
case VKEY_RMENU:
186-
if(release) {
187-
*flags &= ~input_t::ALT;
188-
}
189-
else {
190-
*flags |= input_t::ALT;
191-
}
192-
break;
193-
}
194-
}
195-
196158
void print(PNV_REL_MOUSE_MOVE_PACKET packet) {
197159
BOOST_LOG(debug)
198160
<< "--begin relative mouse move packet--"sv << std::endl
@@ -404,7 +366,45 @@ short map_keycode(short keycode) {
404366

405367
return keycode;
406368
}
407-
369+
370+
/**
371+
* Update flags for keyboard shortcut combo's
372+
*/
373+
inline void update_shortcutFlags(int *flags, short keyCode, bool release) {
374+
switch(map_keycode(keyCode)) {
375+
case VKEY_SHIFT:
376+
case VKEY_LSHIFT:
377+
case VKEY_RSHIFT:
378+
if(release) {
379+
*flags &= ~input_t::SHIFT;
380+
}
381+
else {
382+
*flags |= input_t::SHIFT;
383+
}
384+
break;
385+
case VKEY_CONTROL:
386+
case VKEY_LCONTROL:
387+
case VKEY_RCONTROL:
388+
if(release) {
389+
*flags &= ~input_t::CTRL;
390+
}
391+
else {
392+
*flags |= input_t::CTRL;
393+
}
394+
break;
395+
case VKEY_MENU:
396+
case VKEY_LMENU:
397+
case VKEY_RMENU:
398+
if(release) {
399+
*flags &= ~input_t::ALT;
400+
}
401+
else {
402+
*flags |= input_t::ALT;
403+
}
404+
break;
405+
}
406+
}
407+
408408
void repeat_key(short key_code) {
409409
// If key no longer pressed, stop repeating
410410
if(!key_press[key_code]) {

0 commit comments

Comments
 (0)