[BRLTTY] keycodes description

Aura Kelloniemi kaura.dev at sange.fi
Mon Nov 25 13:54:35 EST 2019


Hello,

Shérab <Sebastien.Hinderer at ens-lyon.org> writes:
 > Aura Kelloniemi (2019/11/23 18:07 +0200):
 > > Can I do something else as well — like
 > > detect which key is pressed or released, not just list key names?

 > Well unless I misunderstand your question you could already do that
 > before, i.e. either read driver-specific key codes or read brltty
 > command codes.

Yes, I just wasn't sure whether there is a driver-specific code to key name
(or key name index) conversion, but Samuel already addressed that bit.

 > > I'm writing brlapi bindings for Rust.

 > That's very cool news! Thanks a lot for doing that. I hope your bindings
 > will be published. It's worth mentionning that the other bindings are
 > stored in the brltty repository so you may want to do the same thing for
 > the Rust bindings.

Or I might just push them to crates.io, which seems to be the Rust way of
doing things. I don't know if distributing these bindings with BRLTTY would
add any value, as Rust uses its own build system, and does not support
installing any Rust libraries or interfaces system-wide, not at least in a
standard way that I know of. This means that in order for anyone to use my
bindings, they would need to have BRLTTY source code available. Maybe in the
future Rust has better support for shared libraries/interfaces.

 > > 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?

 > Well I guess you may want to use some awk scripts to generate Rust
 > things form the .h files in order to take advantage of the symbolic
 > values.

Sorry, I was referring strictly to the BRLAPI_PARAM_* constants, which I
though were macros. I was misinterpreting Samuel's example code. I thought
that there is some macro magic going on which does type casting etc. but it
was actually just an ordinary enum.

Constants defined as macros are not an issue in Rust, as the bindings
generator is able to parse and generate equivalent Rust code for them.

 > See the documentation for brlapi_openConnection. It returns the file
 > descriptor so you definitely can use it in select.

I know. I just did not know if the library needs to send a command to the
server to ask for the key press information, but apparently this is not the
case.

Thanks for all the information!

-- 
Aura


More information about the BRLTTY mailing list