I am unable to use cmd in a key map.
super
(S
): Windows key, Command key
(define-configuration buffer
((override-map (let ((map (make-keymap "override-map")))
(define-key map
"S-w" 'delete-current-buffer)))))
Try running nyxt --system-information
so we can have an idea of what system you’re running.
dj_goku
November 9, 2022, 11:07pm
3
For added context the arch linux VM is running in Parallels on a M1 system.
[johnny@myhostname ~]$ nyxt --system-information
Nyxt version: 2.2.4
Renderer version: GI-GTK
Operating system kernel: Linux 5.19.4-1-aarch64-ARCH
Lisp implementation: SBCL 2.2.2 (Dynamic space size: 3221225472)
Features: (:WEBKIT2 :WEBKIT2-2.36 :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING
:WEBKIT2-MUTE :WEBKIT2-EMOJI :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22
:GTK-3-20 :GTK-3-18 :GTK-3-16 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6
:GTK-3-4 :GTK :GDK-3-22 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12
:GDK-3-10 :GDK-3-8 :GDK-3-6 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF
:GLIB-2-30 :GLIB-2-32 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40 :GLIB-2-42
:GLIB-2-44 :GLIB-2-46 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54 :GLIB-2-56
:GLIB-2-58 :GLIB :NYXT-2 :FSET-EXT-STRINGS :CUSTOM-HASH-TABLE-NATIVE :SWANK
:PLUMP-UTF-32 :GLOBAL-VARS :DECLARE-TYPES :PARENSCRIPT
:SBCL+SAFE-STANDARD-READTABLE :NAMED-READTABLES :LPARALLEL :21BIT-CHARS
:CHUNGA :CLOSER-MOP :CL-PPCRE-UNICODE :FLEXI-STREAMS :CL-UNICODE :CL-PPCRE
:CL-JSON-DOUBLE-FLOAT-IS-SUBSUMED :CL-JSON-SINGLE-FLOAT-IS-SUBSUMED
:BORDEAUX-THREADS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS
:LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE CHIPZ-SYSTEM:GRAY-STREAMS
CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:UNIX :CFFI CFFI-SYS::FLAT-NAMESPACE
ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO :SBCL-USES-SB-ROTATE-BYTE
:CL-JSON-CLOS :CL-JSON :THREAD-SUPPORT :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3
:ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ARM64 :GENCGC
:64-BIT :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
:PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS
:SB-THREAD :SB-UNICODE :SBCL :UNIX)
ASDF version: 3.3.1
ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY)
Critical dependencies: (/build/nyxt/src/nyxt/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd
/build/nyxt/src/nyxt/_build/cl-gobject-introspection/cl-gobject-introspection.asd
/build/nyxt/src/nyxt/_build/cl-webkit/webkit2/cl-webkit2.asd)
Guix version:
aadcg
November 11, 2022, 8:07am
4
What program are you using to run the virtual machine? Could it be intercepting that key?
aadcg
November 11, 2022, 11:17am
5
I should also mention that, while that achieves your goal, it is not recommended.
The override-map
is the almighty keymap that takes precedence over all the others.
From Nyxt, you can consult the built-in manual (C-space
manual). Search for the section that mentions *my-keymap*
. Does that help?
Are you running under X11, Wayland, or even XWayland? If X11, you can run xinput test
and see if it even sees the key combo…
dj_goku
November 12, 2022, 5:16pm
7
I am thinking it is emacs is intercepting the s-w
keys. Thoughs-t
is working and can see s-t
when I run describe-key
in nyxt.
I am using Emacs Window Manger (exwm) in Linux.
aadcg
November 13, 2022, 9:59pm
8
That key in bound by default in EXWM when you have the following (exwm-config-example)
in your Emacs init file.
Regardless, this a topic orthogonal to Nyxt
1 Like
dj_goku
November 14, 2022, 4:17pm
9
HA. I just found that before seeing your comment.
(add-hook 'exwm-update-class-hook
(lambda ()
(exwm-workspace-rename-buffer exwm-class-name)))
;; Global keybindings.
(unless (get 'exwm-input-global-keys 'saved-value)
(setq exwm-input-global-keys
`(
;; 's-r': Reset (to line-mode).
([?\s-r] . exwm-reset)
;; 's-w': Switch workspace.
([?\s-w] . exwm-workspace-switch)
;; 's-&': Launch application.
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; 's-N': Switch to certain workspace.
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
After un-binding the s-w
in exwm all is working!
Here is my working config:
(define-configuration buffer
((default-modes (append '(emacs-mode) %slot-default%))
(override-map (let ((map (make-keymap "override-map")))
(define-key map
"S-w" 'delete-current-buffer ; this doesn't seem to be working
"S-t" 'make-buffer-focus
"S-f" 'nyxt/web-mode:search-buffer)))))
(define-configuration browser
((session-restore-prompt :always-restore)))
See, this is one of the reasons I chose not to use EXWM - I’d hate to have overlapping keybindings with my OS glorified text editor… glad you could figure it out, though!
aadcg
November 21, 2022, 1:12pm
11
EXWM accounts for all of that.