libxkbcommon/test
Ran Benita 2a2a8d7da1 state: apply capitalization transformation on keysyms
The xkbproto spec says:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Lock_Modifier

    If the Lock modifier is not consumed by the symbol lookup process,
    routines that determine the symbol and string that correspond to
    an event should capitalize the result.

This was not an issue until now, because most xkeyboard-config keymaps
do not utilize this "feature", and specify the keysyms for the Lock
modifier explicitly instead. However, some keymaps do depend on it, e.g.
ch(fr) for eacute and others.

The spec goes on to describe two options for doing this transformation:
locale-sensitive and locale-insensitive. We opt for the latter; it is
less desirable but we don't want *that* headache.

Also, only xkb_state_key_get_one_sym() is changed;
xkb_state_key_get_syms() is left as-is, and always reports the
untransformed keysyms. This is for the following reasons:

- The API doesn't allow it, since we return a const pointer directly to
  the keymap keysyms table and we can't transform that.

- The transformation doesn't make sense for multiple-keysyms.

- It can be useful for an application to get the "raw" keysyms if it
  wants to (e.g. maybe it wants to do the transformation itself).

Finally, note that xkb_state_mod_index_is_consumed() does *not*
report Lock as consumed even if it was used in the transformation. This
is what Xlib does.

This definitely doesn't fall under the "hard to misuse" API rule but
it's the best we can do.

https://bugs.freedesktop.org/show_bug.cgi?id=67167

Reported-By: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-08-15 09:58:50 +03:00
..
data test: make sure keycode 0 works fine 2013-08-14 11:37:57 +03:00
.gitignore keymap: add xkb_keymap_new_from_buffer() 2013-04-01 18:04:06 +01:00
bench-key-proc.c test: Add flags argument to test_get_context() 2013-03-19 10:28:23 +00:00
buffercomp.c keymap: add xkb_keymap_new_from_buffer() 2013-04-01 18:04:06 +01:00
common.c test/keyseq: add de(neo) Level{6,7,8} tests 2013-07-25 13:21:33 +03:00
context.c atom: really work with non-NUL-terminated strings 2013-07-22 11:02:20 +03:00
filecomp.c scanner: allow empty key name literals 2013-08-02 11:40:27 +03:00
interactive.c test/interactive: use xkb_state_key_get_one_sym() when there's only 1 2013-08-15 09:58:50 +03:00
keyseq.c test/keyseq: add de(neo) Level{6,7,8} tests 2013-07-25 13:21:33 +03:00
keysym.c keysym: add xkb_keysym_to_{lower,upper} 2013-08-15 09:58:50 +03:00
log.c test: Use test_get_context() in log.c 2013-03-19 10:34:28 +00:00
print-compiled-keymap.c test: Add flags argument to test_get_context() 2013-03-19 10:28:23 +00:00
rmlvo-to-kccgst.c Add environment overrides for default RMLVO 2013-03-19 10:53:37 +00:00
rules-file.c test: Add flags argument to test_get_context() 2013-03-19 10:28:23 +00:00
rulescomp.c scanner: don't fail over unknown escape sequence 2013-08-13 14:52:11 +03:00
state.c state: apply capitalization transformation on keysyms 2013-08-15 09:58:50 +03:00
stringcomp.c xkbcomp: escape the section names before storing them in the keymap 2013-07-18 14:50:21 +03:00
test.h Get rid of the usage of PATH_MAX 2013-07-24 12:08:11 +03:00