Re: [AD] Keyconf problem?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sat, 2005-03-12 at 03:23 +1100, Peter Wang wrote:

> In case you didn't see it, I emulated the OS repeat settings in the 
> new_api_branch.
> 

I did see you have key repeat handling there, but I thought it was
because you removed Allegro's keyboard repeating from the core.. so
didn't look closer. Seems you still need to create a timer though..?

> >+      /* Nice, seems Windows has a function to just get the unicode character. */
> >+      n = ToUnicode(vkey, scancode, keystate, chars, sizeof chars, 0);
> >+      if (n)
> >  
> >
> This should probably be "if (n==1)"; see below.
> 
> >+      {
> >+         /* Additional characters are dropped, since I'm not sure when exactly this occurs. */
> >+	 unicode = chars[0];
> >+      }
> >+      else
> >+         unicode = 0;
> >+   }
> > 

Yes. But it doesn't seem to emit any dead keys. I'll try and let it
print out the extra keys if n > 1. But if 2 or more keys are stored,
wouldn't it be better in any case to read at least the first, than
ignoring completely with n==1?

> 
> I guess the way to handle it is to push all the characters from `chars' 
> into the readkey()-buffer if the return value of ToUnicode() is > 0.  It 
> would require changes to the common keyboard code though.
> 

Hm. I must look at it closer I guess. Maybe it actually stores dead keys
somewhere? That would be really nice.

Otherwise, personally, I think it still is an advantage over the current
driver, even if in theory the pckeys.c driver can handle dead keys. Do
you know if e.g. SDL can report back dead keys?

Hm, and do you have any opinion about a non-DirectInput driver? If we're
lucky, it would be quite simple to just call allegro's handle_keypress
whenever a MSG_KEY (or whatever it is) is received in the windows events
loop. To me that seems to have only advantages. I guess, DirectInput is
supposed to respond faster - but if we have to call GetKeyboardState for
every key instead of just handling the DX event, that probably isn't
true anymore..

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/