[BRLTTY] keycodes description

Samuel Thibault samuel.thibault at ens-lyon.org
Sat Nov 23 10:41:15 EST 2019


Hello,

Samuel Thibault, le ven. 09 août 2019 00:48:10 +0200, a ecrit:
> Quartel, Eric de, le ven. 02 août 2019 14:22:22 +0000, a ecrit:
> > I “connect” here the key with the keycode, for example ThumbLeft FWINLT.
> > 
> > I would like to see the key (in this case ”Thumbleft”) when I type this key on
> > the brailledisplay.
> > 
> > How can I can get this string?
> 
> There is currently no way to do this, but we are finishing an API which
> will allow to do it, stay tuned :)

This is now in!

You can use

size_t len, i;
brlapi_param_keyCode_t *keys = brlapi_getParameterAlloc(BRLAPI_PARAM_DEVICE_KEY_CODES, 0, 1, &len);

len /= sizeof(*keys);

for (i = 0; i < len; i++)
{
	char *name = brlapi_getParameterAlloc(BRLAPI_BRLAPI_PARAM_KEY_SHORT_NAME, keys[i], 1, NULL);
	printf("key %x name %s\n", keys[i], name);
	free(name);
}

free(keys);

Samuel


More information about the BRLTTY mailing list