Commit Graph

6 Commits (600caac33ade86607372e9cb326fe14c8c2b25d6)

Author SHA1 Message Date
Daniel Stone 1eda9e44b1 test: Use test_compile_*() in interactive
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-08 13:30:24 +02:00
Daniel Stone 055b303493 tests: Fix uninitialised-use-of-'ret' warning
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-08 13:30:24 +02:00
Daniel Stone 3f0169424f test: Use test_get_context() in interactive
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-08 13:30:24 +02:00
Ran Benita 1a930bf256 Add API to query whether a modifier is consumed
Currently the user has no way of knowing which of the active modifiers
have been used in the translation of a keycode to its keysyms. The use
case is described in the GTK docs: say there's a menu accelerator
activated by "<Alt>+". Some layouts have "+" shifted, and some have it
on the first level. So in keymaps where "+" is shifted, the Shift
modifier is consumed and must be ignored when the user is testing
for "<Alt>+". Otherwise, we may get "<Alt><Shift>+" and the accelerator
should not actually fire.

For this we also use the preserve[] information in the key types, which
can forces us to report modifiers as unconsumed even if they were used
in the translation. Until now we didn't do anything with this
information.

The API tries to match its surronding. It's not very efficient but this
can be fixed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-08-08 10:03:38 +03:00
Ran Benita 1d570a6d46 interactive: add support to run from keymap file
This is useful for quickly testing a random keymap file. Use -k <PATH>.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-08-07 11:09:42 +03:00
Ran Benita 4c21275301 Add an interactive evdev test
The program reads key events from evdev input devices, puts them through
the library and prints some information about them. It's nice for
experimenting, quick testing and trying to break it with random stuff
(already found some!).

It is called "interactive" for lack of a better name. It's a bit
hackish, but can easily be extended, made more portable etc, in the
future.

Signed-off-by: Ran Benita <ran234@gmail.com>

Conflicts:
	Makefile.am
	test/.gitignore
2012-07-28 11:43:15 +02:00