[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Show modeline when super key is pressed
From: |
szos |
Subject: |
Re: Show modeline when super key is pressed |
Date: |
Tue, 31 Dec 2024 19:20:17 +0000 |
>
> Some additional code to allow holding super to display the mode line:
>
> ``` lisp
> (defun custom-press-handler (code state)
> (declare (ignore state))
> (let ((super-keycodes (nth-value 6 (xlib:modifier-mapping *display*))))
> (when (member code super-keycodes :test #'=)
> (toggle-mode-line (current-screen) (current-head))
> t)))
>
> (define-stump-event-handler :key-release (code state)
> (declare (ignore state))
> (let ((super-keycodes (nth-value 6 (xlib:modifier-mapping *display*))))
> (when (member code super-keycodes :test #'=)
> (toggle-mode-line (current-screen) (current-head))
> t)))
>
> (setf *custom-key-event-handler* 'custom-press-handler)
> ```
NB: the above code requires you to grab the super keycode, which for me
is 133, though you can find it by calling xlib:modifier-mapping.
You can grab it like so in your init file:
``` lisp
(xlib:ungrab-key (screen-root (current-screen)) your-super-key-code)
```
- Re: Show modeline when super key is pressed, Toby Worland, 2024/12/01
- Re: Show modeline when super key is pressed, Daniel Radetsky, 2024/12/02
- Message not available
- Re: Show modeline when super key is pressed, Daniel Radetsky, 2024/12/10
- Re: Show modeline when super key is pressed, szos, 2024/12/15
- Re: Show modeline when super key is pressed, szos, 2024/12/31
- Re: Show modeline when super key is pressed, Lillia, 2024/12/31
- Re: Show modeline when super key is pressed, Daniel Radetsky, 2024/12/31
- Re: Show modeline when super key is pressed, Lillia, 2024/12/31
- Re: Show modeline when super key is pressed,
szos <=
- Re: Show modeline when super key is pressed, szos, 2024/12/31