Skip to content

Commit 2da892c

Browse files
author
Naruhito
committed
Proxy extended mouse button 8, 9 events
#2860 (comment)
1 parent 96ad8c8 commit 2da892c

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

neutrinordp/xrdp-neutrinordp.c

+24-12
Original file line numberDiff line numberDiff line change
@@ -425,24 +425,36 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
425425
case 110:
426426
break;
427427

428-
case 115: /* side back button up (multi-device mouse) */
429-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x4000, 0x38); //Alt down
430-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x4100, 0x4B); //Left down
431-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x8100, 0x4B); //Left up
432-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x8000, 0x38); //Alt up
428+
case 115: /* extended mouse button8 up */
429+
LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button8 up %ld %ld", param1, param2);
430+
x = param1;
431+
y = param2;
432+
flags = PTR_XFLAGS_BUTTON1;
433+
mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y);
433434
break;
434435

435-
case 116: /* side back button down (multi-device mouse) */
436+
case 116: /* extended mouse button8 down */
437+
LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button8 down %ld %ld", param1, param2);
438+
x = param1;
439+
y = param2;
440+
flags = PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_DOWN;
441+
mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y);
436442
break;
437443

438-
case 117: /* side forward button up (multi-device mouse) */
439-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x4000, 0x38); //Alt down
440-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x4100, 0x4D); //Right down
441-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x8100, 0x4D); //Right up
442-
mod->inst->input->KeyboardEvent(mod->inst->input, 0x8000, 0x38); //Alt up
444+
case 117: /* extended mouse button9 up */
445+
LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button9 up %ld %ld", param1, param2);
446+
x = param1;
447+
y = param2;
448+
flags = PTR_XFLAGS_BUTTON2;
449+
mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y);
443450
break;
444451

445-
case 118: /* side forward button down (multi-device mouse) */
452+
case 118: /* extended mouse button9 down */
453+
LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button9 down %ld %ld", param1, param2);
454+
x = param1;
455+
y = param2;
456+
flags = PTR_XFLAGS_BUTTON2 | PTR_XFLAGS_DOWN;
457+
mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y);
446458
break;
447459

448460
case 200:

0 commit comments

Comments
 (0)