summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-12-07 15:39:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-12-13 10:35:24 +1000
commit00e0c176889d1878aa077b9869f3ea02ca0cf968 (patch)
tree7e2fa9b1c4c63605573eab8b0af0f11ef313511d
parenta1e9150210abda0d3dd41127330cd7985d29957d (diff)
downloadlibinput-00e0c176889d1878aa077b9869f3ea02ca0cf968.tar.gz
doc/user: write an article explaining the different contexts
This is a common question I need to answer, let's make this a link I can copy/paste instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--doc/user/faqs.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/user/faqs.rst b/doc/user/faqs.rst
index b3afa8d2..f7dbc124 100644
--- a/doc/user/faqs.rst
+++ b/doc/user/faqs.rst
@@ -335,3 +335,27 @@ are more specialized (e.g. in-vehicle infotainment or IVI) can handle input
devices directly but the compositor you want to use
on your desktop needs an input stack that is more complex. And right now,
libinput is the only input stack that exists for this use-case.
+
+.. _faq_separate_contexts:
+
+------------------------------------------------------------------------------
+Can I write a program to make libinput do $FOO
+------------------------------------------------------------------------------
+
+A common question is whether it's possible to write a program that can change
+libinput's behavior - specifically the libinput that is used inside the
+compositor. This indicates a misunderstanding of how libinput works:
+libinput is a library that converts kernel events into libinput events, much
+like ``sed`` reads data in, modifies it, and provides it to stdout.
+
+If ``sed`` is used by a shell-script, that script has full control over how
+``sed`` processes data. In this analogy, ``sed`` is libinput and the
+shell script is the compositor. It is not possible to write a program
+to modify the behavior of the ``sed`` instance used inside that shell script
+
+Writing a program that uses libinput is akin to writing a new script that
+invoke ``sed``. It will not have any effect on the original ``sed`` instance.
+
+The only way to modify libinput's behavior is to use the configuration options
+exposed by the respective compositor. Those affect the libinput context inside
+the compositor and thus have an effect on the input device behavior.