[BRLTTY] keycodes description

Aura Kelloniemi kaura.dev at sange.fi
Sat Nov 23 11:07:07 EST 2019


Hello,

Absolutely great work Samuel! Thank you!

Samuel Thibault <samuel.thibault at ens-lyon.org> writes:
 > 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);

Is there also some documentation? Can I do something else as well — like
detect which key is pressed or released, not just list key names?

I'm writing brlapi bindings for Rust. Can I use this new API across FFI
without the need for using the CPP macros, as they probably cannot be nicely
translated to Rust code? (A pointer to an internal structure is fine, if it
stays valid while I copy the data to a Rust string.)

[This is a bit off-topic, but I will probably never ask it, if I don't write
it here:]
I'd like to be able to use brlapi in a main loop, where I use poll/select to
wait for I/O events from file descriptors. Can I somehow do this with brlapi?

-- 
Aura


More information about the BRLTTY mailing list