Enlarge keysym name buffers and mention in comment
The longest keysym is 27 chars long. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
010242593e
commit
1f49290131
|
@ -140,12 +140,14 @@ extern "C" {
|
||||||
/*
|
/*
|
||||||
* Returns the name for a keysym as a string; will return unknown Unicode
|
* Returns the name for a keysym as a string; will return unknown Unicode
|
||||||
* codepoints as "Ua1b2", and other unknown keysyms as "0xabcd1234".
|
* codepoints as "Ua1b2", and other unknown keysyms as "0xabcd1234".
|
||||||
|
* If the buffer passed is too small, the string is truncated; a size of
|
||||||
|
* at least 32 bytes is recommended.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size);
|
xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See xkb_keysym_to_string comments: this function will accept any string
|
* See xkb_keysym_get_name comments: this function will accept any string
|
||||||
* from that function.
|
* from that function.
|
||||||
*/
|
*/
|
||||||
xkb_keysym_t
|
xkb_keysym_t
|
||||||
|
|
|
@ -646,7 +646,7 @@ write_compat(struct xkb_keymap *keymap, char **buf, size_t *size,
|
||||||
if (interp->sym == XKB_KEY_NoSymbol)
|
if (interp->sym == XKB_KEY_NoSymbol)
|
||||||
sprintf(keysym_name, "Any");
|
sprintf(keysym_name, "Any");
|
||||||
else
|
else
|
||||||
xkb_keysym_get_name(interp->sym, keysym_name, 64);
|
xkb_keysym_get_name(interp->sym, keysym_name, sizeof(keysym_name));
|
||||||
|
|
||||||
write_buf(keymap, buf, size, offset, "\t\tinterpret %s+%s(%s) {\n",
|
write_buf(keymap, buf, size, offset, "\t\tinterpret %s+%s(%s) {\n",
|
||||||
keysym_name,
|
keysym_name,
|
||||||
|
|
|
@ -241,7 +241,7 @@ XkbcActionTypeText(unsigned type)
|
||||||
const char *
|
const char *
|
||||||
XkbcKeysymText(xkb_keysym_t sym)
|
XkbcKeysymText(xkb_keysym_t sym)
|
||||||
{
|
{
|
||||||
static char buffer[16];
|
static char buffer[64];
|
||||||
|
|
||||||
xkb_keysym_get_name(sym, buffer, sizeof buffer);
|
xkb_keysym_get_name(sym, buffer, sizeof buffer);
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ test_key_seq(struct xkb_keymap *keymap, ...)
|
||||||
|
|
||||||
const xkb_keysym_t *syms;
|
const xkb_keysym_t *syms;
|
||||||
unsigned int nsyms, i;
|
unsigned int nsyms, i;
|
||||||
char ksbuf[16];
|
char ksbuf[64];
|
||||||
|
|
||||||
state = xkb_state_new(keymap);
|
state = xkb_state_new(keymap);
|
||||||
assert(state);
|
assert(state);
|
||||||
|
|
Loading…
Reference in New Issue