mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: don't allow setting macros where not supported
Fixes #585 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
cf9a3e48b7
commit
1586913fc7
@@ -379,12 +379,17 @@ def func_button_get(r, args):
|
||||
|
||||
def func_button_action_set_button(r, args):
|
||||
b, p, d = find_button(r, args)
|
||||
if not d.CAP_BUTTON in d.capabilities:
|
||||
raise RatbagErrorCapability("assigning a button is not supported on this device")
|
||||
b.mapping = args.target_button
|
||||
commit(d, args)
|
||||
|
||||
|
||||
def func_button_action_set_special(r, args):
|
||||
b, p, d = find_button(r, args)
|
||||
if not d.CAP_BUTTON in d.capabilities:
|
||||
raise RatbagErrorCapability("assigning a button is not supported on this device")
|
||||
|
||||
try:
|
||||
special = args.target_special
|
||||
except AttributeError:
|
||||
@@ -396,6 +401,9 @@ def func_button_action_set_special(r, args):
|
||||
|
||||
def func_button_action_set_macro(r, args):
|
||||
b, p, d = find_button(r, args)
|
||||
if not d.CAP_BUTTON_MACROS in d.capabilities:
|
||||
raise RatbagErrorCapability("assigning a macro is not supported on this device")
|
||||
|
||||
macro_keys = args.target_macro
|
||||
macro = RatbagdMacro()
|
||||
for s in macro_keys:
|
||||
|
||||
Reference in New Issue
Block a user