latest
This commit is contained in:
1 parent
df2540c6b7
commit
d48198e199
8 files changed
+92
-41
No files matched your search
@@ -9,14 +9,16 @@
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, flake-utils
|
||||
,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
# Python with the packages needed by the offline converter tools
|
||||
pythonEnv = pkgs.python3.withPackages (
|
||||
@@ -36,7 +38,7 @@
|
||||
version = "1.0";
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [makeWrapper];
|
||||
nativeBuildInputs = with pkgs; [ makeWrapper ];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
gcc
|
||||
@@ -45,7 +47,7 @@
|
||||
|
||||
# python3 is needed by checkPhase: `make test-c` shells out to
|
||||
# `python3 tools/run_tests.py` (see c/Makefile, PYTHON ?= python3).
|
||||
nativeCheckInputs = with pkgs; [python3];
|
||||
nativeCheckInputs = with pkgs; [ python3 ];
|
||||
|
||||
# Use x86-64-v3 (AVX2) for a portable binary; override with ARCH=native for local builds
|
||||
ARCH =
|
||||
@@ -122,7 +124,7 @@
|
||||
|
||||
buildInputs =
|
||||
old.buildInputs
|
||||
++ (with pkgs.rocmPackages; [clr rocm-runtime hipblas]);
|
||||
++ (with pkgs.rocmPackages; [ clr rocm-runtime hipblas ]);
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
@@ -139,9 +141,10 @@
|
||||
# build), and the GPU path needs real hardware — so skip the suite.
|
||||
doCheck = false;
|
||||
|
||||
meta = old.meta // {platforms = pkgs.lib.platforms.linux;};
|
||||
meta = old.meta // { platforms = pkgs.lib.platforms.linux; };
|
||||
});
|
||||
in {
|
||||
in
|
||||
{
|
||||
packages =
|
||||
{
|
||||
default = colibri;
|
||||
@@ -166,7 +169,7 @@
|
||||
formatter = pkgs.alejandra;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [colibri];
|
||||
inputsFrom = [ colibri ];
|
||||
|
||||
packages = with pkgs; [
|
||||
pythonEnv
|
||||
+22
-6
@@ -1,15 +1,31 @@
|
||||
from collections.abc import Iterable
|
||||
|
||||
import evdev
|
||||
from evdev import ecodes
|
||||
|
||||
|
||||
def identify_touchscreen_via_evdev() -> Iterable[evdev.InputDevice]:
|
||||
"""Yield the real touchscreens, selected by capability rather than by name.
|
||||
|
||||
INPUT_PROP_DIRECT is the kernel's own statement that the device's coordinates
|
||||
map directly onto the display, which is what distinguishes a touchscreen from
|
||||
the two kinds of device that otherwise look identical:
|
||||
|
||||
* a touchpad, which is absolute but reports INPUT_PROP_POINTER instead
|
||||
* a synthetic pointer such as `dotool absolute pointer`, which reports
|
||||
ABS_X/ABS_Y and no props at all
|
||||
|
||||
Matching on ABS_X/ABS_Y and an absent "touchpad"/"mouse" substring used to
|
||||
accept both, so the daemon detected its own click-forwarding device as a
|
||||
second touchscreen and refused to start.
|
||||
|
||||
Multitouch axes are required as well: a device without them cannot report the
|
||||
finger counts every gesture in the detector is defined in terms of.
|
||||
"""
|
||||
for path in evdev.list_devices():
|
||||
dev = evdev.InputDevice(path)
|
||||
name_lower = dev.name.lower()
|
||||
if "touchscreen" in name_lower or "touch panel" in name_lower:
|
||||
if ecodes.INPUT_PROP_DIRECT not in dev.input_props():
|
||||
continue
|
||||
abs_axes = dev.capabilities(absinfo=False).get(ecodes.EV_ABS, [])
|
||||
if ecodes.ABS_MT_POSITION_X in abs_axes and ecodes.ABS_MT_POSITION_Y in abs_axes:
|
||||
yield dev
|
||||
if caps := dev.capabilities(absinfo=False).get(evdev.ecodes.EV_ABS):
|
||||
if evdev.ecodes.ABS_X in caps and evdev.ecodes.ABS_Y in caps:
|
||||
if ("mouse" not in name_lower) and ("touchpad" not in name_lower):
|
||||
yield dev
|
||||
Reference in new issue
Block a user