From d7c91a15f8ded0407a8391ec8bc8c02fac6fbca3 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 28 Feb 2014 14:50:48 +0200 Subject: [PATCH] doc: add comments about update_key() and get_syms() order I remember we had a comment about this, but I can't find it. So add it again. Signed-off-by: Ran Benita --- xkbcommon/xkbcommon.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h index 908edce..86f0a85 100644 --- a/xkbcommon/xkbcommon.h +++ b/xkbcommon/xkbcommon.h @@ -1157,6 +1157,13 @@ enum xkb_state_component { * is pressed twice, it should be released twice; etc. Otherwise (e.g. due * to missed input events), situations like "stuck modifiers" may occur. * + * This function is often used in conjunction with the function + * xkb_state_key_get_syms() (or xkb_state_key_get_one_sym()), for example, + * when handling a key event. In this case, you should prefer to get the + * keysyms *before* updating the key, such that the keysyms reported for + * the key event are not affected by the event itself. This is the + * conventional behavior. + * * @returns A mask of state components that have changed as a result of * the update. If nothing in the state has changed, returns 0. * -- 2.7.4