[BRLTTY] brlapi and autorepeat

Peter Nilsson Lundblad plundblad at google.com
Wed Jun 12 16:41:28 EDT 2013



Dave Mielke writes:
> [quoted lines by Peter Nilsson Lundblad on 2013/06/12 at 10:22 -0700]
> 
> >I'm issuing LNDN for example and that repeats in the text console,
> >but not through brlapi, either in orca or my own python script.
> 
> Yes, LNDN should repeat.
> 
> >Are you saying this is working for others?  If not, maybe we have a bug
> >in the brlapi implementation.  
> 
> Granted, it hasn't been explicitly tested in a while, but it certainly should 
> work according to the code. Now there's this bit of code in brlapi_server.c to 
> consider:
> 
>    2433: /* Check whether the client really wants the result of repetition */
>    2434: pthread_mutex_lock(&c->acceptedKeysMutex);
>    2435: passKey = inKeyrangeList(c->acceptedKeys,clientCode) != NULL;
>    2436: pthread_mutex_unlock(&c->acceptedKeysMutex);
> 
> So maybe there is something wrong with your key range selection. Can you post 
> it?
> 
> A possibility is that you're requesting the command itself, very explicitly, 
> rather than the command with its flags.
> 

My test script is below.  As you can see, I've tried explicitly accepting
the command (LNUP in this case) and using the default.  Do I need to enable commands, with flags, for all commands that I want autorepeat for?
What happens with this script is that, on my Papenmeier display, I only get
the LNUP command when releasing the easybar, while, as I said before,
in the text console autorepeat works just fine.

//Peter


import brlapi
import time

def createConnection():
  c = brlapi.Connection()
  c.enterTtyMode()
  # I tried to add this line, but it doesn't make a difference.  LNUP is accepted by default.
  #c.acceptKeys(brlapi.rangeType_key, [brlapi.KEY_TYPE_CMD|brlapi.KEY_CMD_LNUP])
  print "Created connection", c.driverName, c.displaySize
  return c

c = createConnection()
while True:
  k = c.readKey()
  expanded = c.expandKeyCode(k)
  c.writeText("%d: %s, %s" % (time.time(), c.expandKeyCode(k), c.displaySize))
  print "%d: %s, %s" % (time.time(), c.expandKeyCode(k), c.driverName)


More information about the BRLTTY mailing list