Commit dae818c0 authored by Brandon Invergo's avatar Brandon Invergo

Don't "hold down" the button when toggling a

remap-button-toggle unless an option is set.
parent ae2c29a5
2019-04-01 Brandon Invergo <brandon@invergo.net>
* guile/librekontrol/device.scm (make-remap-button-toggle): Don't
"hold down" the button when toggling a remap-button-toggle unless
an option is set.
2019-03-28 Brandon Invergo <brandon@invergo.net>
* guile/librekontrol/device.scm
......
......@@ -243,13 +243,15 @@ Optional keyword arguments:
#:mod-keys -- List of modifier keys to apply (e.g. key-alt, key-leftctrl,
etc.)
#:on-value -- Event value for when the toggle is turned on (default: 1)
#:off-value -- Event value for when the toggle is turned off (default: 0)"
#:off-value -- Event value for when the toggle is turned off (default: 0)
#:hold-down -- \"Hold down\" the button when toggled on (default: #f)"
(let ((state init-state))
(lambda (device input-event input-value alsa-ctl options)
(let-keywords options #f ((event-code #f)
(mod-keys #f)
(on-value 1)
(off-value 0))
(off-value 0)
(hold-down #f))
(begin
(when (> input-value 0)
(if (not state)
......@@ -259,6 +261,8 @@ Optional keyword arguments:
(send-remap-event device ev-key mod-key 1))
mod-keys))
(send-remap-event device ev-key event-code on-value)
(unless hold-down
(send-remap-event device ev-key event-code off-value))
(when mod-keys
(for-each (lambda (mod-key)
(send-remap-event device ev-key mod-key 0))
......@@ -269,6 +273,8 @@ Optional keyword arguments:
(for-each (lambda (mod-key)
(send-remap-event device ev-key mod-key 1))
mod-keys))
(unless hold-down
(send-remap-event device ev-key event-code on-value))
(send-remap-event device ev-key event-code off-value)
(when mod-keys
(for-each (lambda (mod-key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment