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

cmd_bind{sym,code}: Implement per-device bindings #2875

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

RedSoxFan
Copy link
Member

Closes #2378
Closes #2141

Implements the syntax bind{sym,code} --input-device=<identifier> <...> for both keyboard and mouse bindings.

Since I don't have multiple physical keyboards, I found this easiest to test by launching sway on DRM, on the Wayland backend, and on the X11 backend.

My test config:

set $mod Mod4
set $keyboard <keyboard-id>
set $wl_keyboard 0:0:wayland
set $mouse <mouse-id>
set $wl_mouse 0:0:wayland

bindsym $mod+x exec urxvt -e python
bindsym --input-device=$keyboard $mod+x exec urxvt -e bash
bindsym --input-device=$wl_keyboard $mod+x exec urxvt -e zsh

bindsym --whole-window button3 floating toggle
bindsym --input-device=$mouse --whole-window button3 fullscreen toggle
bindsym --input-device=$wl_mouse --whole-window button3 border toggle

For the config above:

  • urxvt -e python and floating toggle should get triggered on the X11 backend
  • urxvt -e bash and fullscreen toggle should get triggered on DRM
  • urxvt -e zsh and border toggle should get triggered on the Wayland backend

bindsym --input-device=<identifier> ...
bindcode --input-device=<identifier> ...
Copy link
Contributor

@ddevault ddevault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

@ianyfan
Copy link
Contributor

ianyfan commented Oct 18, 2018

I think you should add a property to the ipc binding event for this.

@ddevault
Copy link
Contributor

Sure, but it could be a separate patch.

@ddevault ddevault merged commit 96e3686 into swaywm:master Oct 19, 2018
@ddevault
Copy link
Contributor

Thanks!

@RedSoxFan RedSoxFan deleted the input-device-bindings branch October 19, 2018 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants