Keybinding not working

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.

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: 

What program are you using to run the virtual machine? Could it be intercepting that key?

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…

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.

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 :slight_smile:

1 Like

HA. I just found that before seeing your comment.

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 OSglorified text editor… glad you could figure it out, though!

EXWM accounts for all of that.