}
}
+ [DllImport(lib, EntryPoint = "libinput_device_get_seat", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr DeviceGetSeat(IntPtr device);
+
[DllImport(lib, EntryPoint = "libinput_device_has_capability", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeviceHasCapability(IntPtr device, DeviceCapability capability);
[DllImport(lib, EntryPoint = "libinput_suspend", CallingConvention = CallingConvention.Cdecl)]
public static extern void Suspend(IntPtr libinput);
+
+ [DllImport(lib, EntryPoint = "libinput_seat_get_logical_name", CallingConvention = CallingConvention.Cdecl)]
+ static extern public IntPtr SeatGetLogicalNameInternal(IntPtr seat);
+ public static string SeatGetLogicalName(IntPtr seat)
+ {
+ unsafe
+ {
+ return new string((sbyte*)SeatGetLogicalNameInternal(seat));
+ }
+ }
+
+ [DllImport(lib, EntryPoint = "libinput_seat_get_physical_name", CallingConvention = CallingConvention.Cdecl)]
+ static extern public IntPtr SeatGetPhysicalNameInternal(IntPtr seat);
+ public static string SeatGetPhysicalName(IntPtr seat)
+ {
+ unsafe
+ {
+ return new string((sbyte*)SeatGetPhysicalName(seat));
+ }
+ }
}
enum DeviceCapability
readonly IntPtr Device;
string name;
string output;
+ string logical_seat;
+ string physical_seat;
public DeviceBase(IntPtr device, int id)
{
}
}
+ public IntPtr Seat
+ {
+ get
+ {
+ return LibInput.DeviceGetSeat(Device);
+ }
+ }
+
+ public string LogicalSeatName
+ {
+ get
+ {
+ logical_seat = logical_seat ?? LibInput.SeatGetLogicalName(Seat);
+ return logical_seat;
+ }
+ }
+
+ public string PhysicalSeatName
+ {
+ get
+ {
+ physical_seat = physical_seat ?? LibInput.SeatGetPhysicalName(Seat);
+ return physical_seat;
+ }
+ }
+
public string Output
{
get
{
KeyboardDevice keyboard = new KeyboardDevice(device, Keyboards.Count);
Keyboards.Add(keyboard.Id, keyboard);
- Debug.Print("[Input] Added keyboard device {0} '{1}'", keyboard.Id, keyboard.Name);
+ Debug.Print("[Input] Added keyboard device {0} '{1}' on '{2}' ('{3}')",
+ keyboard.Id, keyboard.Name, keyboard.LogicalSeatName, keyboard.PhysicalSeatName);
}
if (LibInput.DeviceHasCapability(device, DeviceCapability.Mouse))
{
MouseDevice mouse = new MouseDevice(device, Mice.Count);
Mice.Add(mouse.Id, mouse);
- Debug.Print("[Input] Added mouse device {0} '{1}'", mouse.Id, mouse.Name);
+ Debug.Print("[Input] Added mouse device {0} '{1}' on '{2}' ('{3}')",
+ mouse.Id, mouse.Name, mouse.LogicalSeatName, mouse.PhysicalSeatName);
}
if (LibInput.DeviceHasCapability(device, DeviceCapability.Touch))