[BRLTTY] BrlAPI Raw key code mode?

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Jul 30 17:59:44 EDT 2017


Hello,

Mario Lang, on jeu. 27 juil. 2017 21:17:15 +0200, wrote:
> >> The documentation of "Raw keycode" mode does explicitly state that
> >> brlapi_acceptKeyRange() is not necessary.
> >
> > Yes, I know.
> 
> Either the documentation or the code needs to be fixed.
> I would vote for making the code do what the documentation claims.

Agreed :)

The attached patch is probably correct.

Samuel
-------------- next part --------------
diff --git a/Programs/brlapi_server.c b/Programs/brlapi_server.c
index aae04ca16..bed399089 100644
--- a/Programs/brlapi_server.c
+++ b/Programs/brlapi_server.c
@@ -2476,7 +2476,9 @@ finished:
 /* to let the user read the screen in case theree is an error */
 static int initializeAcceptedKeys(Connection *c, int how)
 {
-  if (how != BRL_KEYCODES) {
+  if (how == BRL_KEYCODES) {
+    if (c && addKeyrange(0, BRLAPI_KEY_MAX, &c->acceptedKeys) == -1) return -1;
+  } else {
     if (c) {
       typedef struct {
         int (*action) (brlapi_keyCode_t first, brlapi_keyCode_t last, KeyrangeList **list);


More information about the BRLTTY mailing list