Add new state API
authorDaniel Stone <daniel@fooishbar.org>
Wed, 21 Mar 2012 02:20:07 +0000 (02:20 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Wed, 21 Mar 2012 02:22:04 +0000 (02:22 +0000)
commitecea0d71b29d07c7909d196b2a0bae0cbb43c79d
treebb906d692cc207cf8bfa556deaf1fd0c14cce8e6
parent272ccbf4737ad028101f52abaffb70a075a199f1
Add new state API

Add new API to deal with xkb_state objects, including
xkb_state_update_key, which runs the XKB action machinery internally to
calculate what exactly happens to the state when a given key is pressed
or released.

The canonical way to deal with keys is now:
    struct xkb_state *state = xkb_state_new(xkb);
    xkb_keysym_t *syms;
    int num_syms;

    xkb_state_update_key(state, key, is_down);
    num_syms = xkb_key_get_syms(state, key, &syms);

More state handling API, including a way to get at or ignore preserved
modifiers, is on its way.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
include/xkbcommon/xkbcommon.h
src/Makefile.am
src/XKBcommonint.h
src/map.c
src/state.c [new file with mode: 0644]
test/Makefile.am
test/state.c [new file with mode: 0644]