1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Linux - Added absolute mouse events and commented out debug logs

This commit is contained in:
Diogo Trindade 2022-08-20 17:10:02 +01:00
parent f9b3bc9377
commit ead59635f0
2 changed files with 39 additions and 5 deletions

View File

@ -30,5 +30,21 @@ namespace Artemis.UI.Linux.Providers.Input
ABS_VOLUME = 0x20, ABS_VOLUME = 0x20,
ABS_MISC = 0x28, ABS_MISC = 0x28,
ABS_MT_SLOT = 0x2f, /* MT slot being modified */
ABS_MT_TOUCH_MAJOR = 0x30, /* Major axis of touching ellipse */
ABS_MT_TOUCH_MINOR = 0x31, /* Minor axis (omit if circular) */
ABS_MT_WIDTH_MAJOR = 0x32, /* Major axis of approaching ellipse */
ABS_MT_WIDTH_MINOR = 0x33, /* Minor axis (omit if circular) */
ABS_MT_ORIENTATION = 0x34, /* Ellipse orientation */
ABS_MT_POSITION_X = 0x35, /* Center X touch position */
ABS_MT_POSITION_Y = 0x36, /* Center Y touch position */
ABS_MT_TOOL_TYPE = 0x37, /* Type of touching device */
ABS_MT_BLOB_ID = 0x38, /* Group a set of packets as a blob */
ABS_MT_TRACKING_ID = 0x39, /* Unique ID of initiated contact */
ABS_MT_PRESSURE = 0x3a, /* Pressure on contact area */
ABS_MT_DISTANCE = 0x3b, /* Contact hover distance */
ABS_MT_TOOL_X = 0x3c, /* Center X tool position */
ABS_MT_TOOL_Y = 0x3d, /* Center Y tool position */
} }
} }

View File

@ -52,7 +52,7 @@ namespace Artemis.UI.Linux.Providers.Input
KeyboardKey key = InputUtilities.KeyFromKeyCode((LinuxKeyboardKeyCodes)args.Code); KeyboardKey key = InputUtilities.KeyFromKeyCode((LinuxKeyboardKeyCodes)args.Code);
bool isDown = args.Value != 0; bool isDown = args.Value != 0;
_logger.Verbose($"Keyboard Key: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}"); //_logger.Verbose($"Keyboard Key: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}");
var identifier = keyboard.InputId; var identifier = keyboard.InputId;
@ -72,7 +72,7 @@ namespace Artemis.UI.Linux.Providers.Input
OnKeyboardDataReceived(device, key, isDown); OnKeyboardDataReceived(device, key, isDown);
break; break;
default: default:
_logger.Verbose($"Unknown keyboard event type: {args.Type}"); //_logger.Verbose($"Unknown keyboard event type: {args.Type}");
break; break;
} }
} }
@ -100,7 +100,7 @@ namespace Artemis.UI.Linux.Providers.Input
bool isDown = args.Value != 0; bool isDown = args.Value != 0;
MouseButton button = InputUtilities.MouseButtonFromButtonCode((LinuxKeyboardKeyCodes)args.Code); MouseButton button = InputUtilities.MouseButtonFromButtonCode((LinuxKeyboardKeyCodes)args.Code);
_logger.Verbose($"Mouse Button: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}"); //_logger.Verbose($"Mouse Button: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}");
OnMouseButtonDataReceived(device, button, isDown); OnMouseButtonDataReceived(device, button, isDown);
break; break;
@ -108,7 +108,7 @@ namespace Artemis.UI.Linux.Providers.Input
case LinuxInputEventType.REL: case LinuxInputEventType.REL:
LinuxRelativeAxis relativeAxis = (LinuxRelativeAxis)args.Code; LinuxRelativeAxis relativeAxis = (LinuxRelativeAxis)args.Code;
_logger.Verbose($"Relative mouse: axis={relativeAxis} | value={args.Value}"); //_logger.Verbose($"Relative mouse: axis={relativeAxis} | value={args.Value}");
switch (relativeAxis) switch (relativeAxis)
{ {
@ -126,8 +126,26 @@ namespace Artemis.UI.Linux.Providers.Input
break; break;
} }
break; break;
case LinuxInputEventType.ABS:
LinuxAbsoluteAxis absoluteAxis = (LinuxAbsoluteAxis)args.Code;
//_logger.Verbose($"Absolute mouse: axis={absoluteAxis} | value={args.Value}");
switch (absoluteAxis)
{
case LinuxAbsoluteAxis.ABS_X:
OnMouseMoveDataReceived(device, args.Value, 0, 0, 0);
break;
case LinuxAbsoluteAxis.ABS_Y:
OnMouseMoveDataReceived(device, 0, args.Value, 0, 0);
break;
}
break;
case LinuxInputEventType.SYN:
//ignore
break;
default: default:
_logger.Verbose($"Unknown mouse event type: {args.Type}"); //_logger.Verbose($"Unknown mouse event type: {args.Type}");
break; break;
} }
} }