tablet driver

This commit is contained in:
Kopatz
2024-05-29 15:35:51 +02:00
parent 9980828315
commit 6df154f71d
6 changed files with 51 additions and 2 deletions

View File

@@ -8,5 +8,6 @@
./vfio.nix
./wooting.nix
./tpm.nix
./tablet.nix
];
}

View File

@@ -0,0 +1,32 @@
diff --git a/OpenTabletDriver.Plugin/Log.cs b/OpenTabletDriver.Plugin/Log.cs
index c77d83e1..28577939 100644
--- a/OpenTabletDriver.Plugin/Log.cs
+++ b/OpenTabletDriver.Plugin/Log.cs
@@ -74,7 +74,7 @@ namespace OpenTabletDriver.Plugin
/// <param name="text">Text for the <see cref="LogMessage"/>.</param>
public static void Debug(string group, string text)
{
- Write(group, text, LogLevel.Debug);
+ Write(group, text, LogLevel.Info);
}
/// <summary>
diff --git a/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs b/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs
index c5251855..8daa3d01 100644
--- a/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs
+++ b/OpenTabletDriver.Plugin/Tablet/TiltTabletReport.cs
@@ -1,5 +1,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
+using OpenTabletDriver.Plugin.Logging;
namespace OpenTabletDriver.Plugin.Tablet
{
@@ -27,6 +28,7 @@ namespace OpenTabletDriver.Plugin.Tablet
penByte.IsBitSet(1),
penByte.IsBitSet(2)
};
+ Log.Write("Device", $"{Tilt}");
}
public byte[] Raw { set; get; }

View File

@@ -0,0 +1,14 @@
{ pkgs, config, lib, ... }:
with lib;
let cfg = config.custom.hardware.tablet;
in {
options.custom.hardware.tablet = {
enable = mkEnableOption "Enables tablet";
};
config = mkIf cfg.enable {
hardware.opentabletdriver.enable = true;
#hardware.opentabletdriver.package = pkgs.opentabletdriver.overrideAttrs
# (old: { patches = old.patches ++ [ ./tablet-patches.diff ]; });
};
}