summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gwacom/wacom-device.c15
-rw-r--r--src/gwacom/wacom-device.h10
2 files changed, 25 insertions, 0 deletions
diff --git a/src/gwacom/wacom-device.c b/src/gwacom/wacom-device.c
index 29fb9ae..87ac433 100644
--- a/src/gwacom/wacom-device.c
+++ b/src/gwacom/wacom-device.c
@@ -296,6 +296,21 @@ WacomOptions *wacom_device_get_options(WacomDevice *device)
return device->options;
}
+void wacom_device_set_runtime_option(WacomDevice *device, const char *name, const char *value)
+{
+ WacomDevicePtr priv = device->priv;
+
+ wcmLog(priv, W_ERROR, "Setting special option %s=%s\n", name, value);
+
+ if (g_str_equal(name, "PanButton")) {
+ guint btn = atoi(value) - 1; /* array is zero-indexed, config options use 1-indexed ones */
+ assert(btn < sizeof(priv->key_actions));
+ wcmActionSet(&priv->key_actions[btn], 0, AC_PANSCROLL);
+ } else {
+ wcmLog(priv, W_ERROR, ":::::::::::::::: Unsupported runtime option %s ::::::::::::::::\n", name);
+ }
+}
+
/****************** Driver layer *****************/
int
diff --git a/src/gwacom/wacom-device.h b/src/gwacom/wacom-device.h
index 3ada1dd..546fd9f 100644
--- a/src/gwacom/wacom-device.h
+++ b/src/gwacom/wacom-device.h
@@ -197,6 +197,16 @@ WacomToolType wacom_device_get_tool_type(WacomDevice *device);
*/
WacomOptions *wacom_device_get_options(WacomDevice *device);
+/**
+ * wacom_device_set_runtime_option:
+ *
+ * Some options like button actions are runtime-only and cannot be set through.
+ * WacomOptionx (which maps to the xorg.conf support of the driver).
+ * This is a hack to set some of those options, however the options
+ * and values supported are very specific to the implementation.
+ */
+void wacom_device_set_runtime_option(WacomDevice *device, const char *name, const char *value);
+
/* The following getters are only available after wacom_device_setup() */
int wacom_device_get_num_buttons(WacomDevice *device);