Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyd Virtual Pointer disables KDE Plasma auto "Touch Mode" #827

Open
Cal-Nine opened this issue Sep 8, 2024 · 1 comment
Open

Keyd Virtual Pointer disables KDE Plasma auto "Touch Mode" #827

Cal-Nine opened this issue Sep 8, 2024 · 1 comment

Comments

@Cal-Nine
Copy link

Cal-Nine commented Sep 8, 2024

KDE Plasma has a feature to automatically enable a "Touch Mode" where buttons are larger when 2-in-1 enters tablet mode, i.e. keyboard and mouse are not detected but touchscreen is. The Keyd virtual pointer is detected as a mouse, so while Keyd is enabled, Plasma will never consider the device in tablet mode.

  1. Enable Keyd on touch screen device
  2. Go to KDE Plasma "General Behavior" settings and set "Touch Mode" to "Automatically enable as needed"
  3. Switch device to tablet mode by disconnecting keyboard and mouse

I don't actually use the Keyd virtual pointer, so being able to disable this somehow would do the trick (unless there is a way and I haven't been able to find it).

Operating System: NixOS 24.11
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.8.9 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 15.2 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Manufacturer: Microsoft Corporation
Product Name: Surface Pro 7

@justinvdk
Copy link

Can confirm. It indeed seems like there is not configurable way to disable this.
I see you use nixos; for me I create the following .nix file and put it in my imports and set services.keyd.no-pointer = true;

If I can find the time I will look into making it configurable in keyd; but for now my immediate problem is resolved.
Also, no promises on the repo staying up, so if you want to use this as well I recommend forking as well.

{ config, lib, pkgs, ... }:
{
  options.services.keyd = {
    no-pointer = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Whether to prevent registering a virtual pointer device.
        Implemented by just using https://github.com/justinvdk/keyd; which just removed the relevant code.
      '';
    };
  };
  config = lib.mkIf config.services.keyd.enable {
    services.keyd = {
      keyboards.main.settings = {
        # Default config here.
      };
    };
    nixpkgs.overlays = lib.mkIf config.services.keyd.no-pointer [
      (final: prev: {
        keyd = prev.keyd.overrideAttrs (old: {
          src = pkgs.fetchFromGitHub {
            owner = "justinvdk";
            repo = "keyd";
            rev = "master";
            hash = "sha256-5Xnx1ChW4b9mGUxyiq+tw/9Mwxqor7qm/czNULJDAMM=";
          };
        });
      })
    ];
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants