Advertisement
Zac_McDonald

ELisp Disable Trackpad

Jun 11th, 2023
2,241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.66 KB | None | 0 0
  1. (setq on-laptop t) ; I set this based on an environment variable
  2.  
  3. (when on-laptop
  4.   (defun disable-trackpad (&optional frame)
  5.     (interactive)
  6.     (shell-command "SystemSettingsAdminFlows EnableTouchpad 0"))
  7.   (defun enable-trackpad (&optional frame)
  8.     (interactive)
  9.     (shell-command "SystemSettingsAdminFlows EnableTouchpad 1"))
  10.  
  11.   (add-hook 'focus-in-hook #'disable-trackpad)
  12.   (add-hook 'focus-out-hook #'enable-trackpad)
  13.   (add-hook 'delete-frame-functions #'enable-trackpad)
  14.   (add-hook 'kill-emacs-hook #'enable-trackpad)
  15.  
  16.   (global-set-key (kbd "C-<lwindow>") 'ignore) ; Unrelated but lets you use Ctrl-Windows hotkeys for virtual desktops
  17.   )
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement