[BRLTTY] BrlAPI Raw key code mode?

Mario Lang mlang at delysid.org
Sun Jul 23 05:54:29 EDT 2017


Shérab <Sebastien.Hinderer at ens-lyon.org> writes:

> Mario Lang (2017/07/23 00:12 +0200):
>> Hi.
>> 
>> Does anyone know if Raw keycode mode of BrlAPI does still work?  Here,
>> calling brlapi__readKey after brlapi__enterTtyMode with "HandyTech" as
>> the driver string seems to block forever, while "" as driver string
>> gives me command keys as expected.
>
> Did it work in the past or is that your first attempt with this driver?

If it ever worked for me, it was a looooong time ago.

>> I know the number of users of raw
>> mode might be near to nothing, so I am sort of guessing it might have
>> been broken somewhere in the past?
>
> Actually, it seems the HandyTech driver does not support delivering raw
> key codes yet. It should define the BRL_HAVE_KEY_CODES macro and
> implement the brl_readKey and brl_keyToCommand methods.

Oh!!!  Thanks for reminding me.  Indeed, now it dawns on me that there
is this driver-specific translation mechanism...  This sort of got lost
in the noise (for me) since we have introducted key tables.  I guess I
need to see if the HandyTech driver can be extended with these
translation functions.

> What I find strange, though, is that you do not get a proper error from
> BrlAPI. Normally, if you try to enter in raw keycode mode with a driver
> that does not support it, you should get an oeration not supported
> error, I think.

I just checked, and no, I didn't miss error handling:

BrlAPI::TTY BrlAPI::Connection::tty(int TTY, bool Raw) {
  auto Number = brlapi__enterTtyMode(BrlAPI->handle(), TTY, Raw? "HandyTech" : "");
  if (Number == -1) throw std::system_error(brlapi_errno, std::generic_category());
  return { this, Number };
}
    
It reports an error (no device or address) if I pass an invalid driver
name string.  Maybe it should report a similar error if the driver
string is correct, but the driver doesn't have the translation functions?

>> Also, now that we have symbolic key names, I wonder, is there any
>> possibility to create some sort of "hybrid" raw mode for BrlAPI, which
>> would return key names and press/release status?
>
> Samuel and I should probably think about it, indeed.

Please do.  I have an actual use case herre, which I'd like to implement
in the upcoming months.  I'd like to build a musical instrument (a
control voltage sequencer) out of a Braille display as main (and only) interface.  For
that, having to deal with BRLTTY commands is not very convenient since
what I am building is not a screen reader, rather, it is a native
braille based hardware/software sequencer.  Here is a repository
already, but it only contains binding code for now.  Maybe another
result of this will be modern C++ BrlAPI bindings:
https://github.com/mlang/brlcv

-- 
CYa,
  ⡍⠁⠗⠊⠕ | Blog: <https://blind.guru/>  GitHub: <https://github.com/mlang/>
  .''`. | Twitter: @blindbird23        FaceBook: disyled
 : :' : | SoundCloud: <soundcloud.com/mario-lang>
 `. `'  | YouTube: <youtube.com/user/mlang23>
   `-


More information about the BRLTTY mailing list