[BRLTTY] Almost done with my brltty driver...

timothyhobbs at seznam.cz timothyhobbs at seznam.cz
Mon Mar 12 22:58:10 EDT 2012


Thank you for your fast reply :)  The new code works beautifully(and doesn't block!

static int
brl_readCommand (BrailleDisplay *brl, KeyTableCommandContext context) {
  if(in_waiting)
  {
    in_waiting=0;
    switch(key){
      case SCROLL_LEFT: printf("SCROLL_LEFT\n");
                        enqueueCommand(BRL_CMD_FWINLT);break;
      case SCROLL_RIGHT: printf("SCROLL_RIGHT\n");
                         enqueueCommand(BRL_CMD_FWINRT);break;
      default:printf("Keypress%d \n",key);
              enqueueKeyEvent(VO_SET_NavigationKeys, key, 0);
    }
  }
  return EOF;
}

Reading over the voyager code, I think that the keys I'm refering to with default are called routing keys.  They normally appear just above the cell and allow you to do things like click and easilly set the cursor possition.  I should say, that I would happilly use the keytables as done in the voyager driver, and as you sugested a month back, but I really don't understand how they work.  I've never even seen such a data structure in C, is it done with a macro?  Where do the strings "Dot1", "JoystickEnter",ect come from?  What do they represent?  Is there a reason for me to use the key tables?  I probably shouldn't re-write my code now that I'm almost done though...  But I have in mind to learn how to do this "the right way(tm)" because there was some talk at my hackerspace(brmlab.cz) that we might take the http://www.raspberrypi.org/ and try to make a "$100 computer for the blind."  and the idea is so close within reach, and so awsome sounding that I can hardly give it up :)

Thank you so much for your help,
Timothy

> ------------ Původní zpráva ------------
> Od: Dave Mielke <dave at mielke.cc>
> Předmět: Re: [BRLTTY] Almost done with my brltty driver...
> Datum: 13.3.2012 01:45:06
> ----------------------------------------
> [quoted lines by timothyhobbs at seznam.cz on 2012/03/12 at 22:31 +0100]
> 
> >static int
> >brl_readCommand (BrailleDisplay *brl, KeyTableCommandContext context) {
> >  sem_wait(&key_waiting);
> 
> This function shouldn't block. It's okay for an experiment, but it shouldn't 
> say like that. It should continue processing device input as long as there is 
> device input, and then return EOF.
> 
> >  switch(key){
> >      case SCROLL_LEFT: printf("SCROLL_LEFT\n");break;
> 
> enqueueCommand(BRL_CMD_FWINLT);
> /* see brldefs.h */
> 
> >      case SCROLL_RIGHT: printf("SCROLL_RIGHT\n");break;
> 
> enqueueCommand(BRL_CMD_FWINRT);
> /* yes, a lot of these could do with nicer names - blame history */
> 
> >That last default, is when a braille cell's button gets pressed.
> 
> What's supposed to happen when this is done?
> 
> -- 
> Dave Mielke           | 2213 Fox Crescent | The Bible is the very Word of God.
> Phone: 1-613-726-0014 | Ottawa, Ontario   | 2011 May 21 is the End of
> Salvation.
> EMail: dave at mielke.cc | Canada  K2A 1H7   | http://Mielke.cc/now.html
> http://FamilyRadio.com/                   | http://Mielke.cc/bible/
> _______________________________________________
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY at mielke.cc
> For general information, go to: http://mielke.cc/mailman/listinfo/brltty
> 
> 
> 


More information about the BRLTTY mailing list