RE: Exclamation Point in DirectInput Key List
- Posted by bensler at mail.com
Feb 20, 2002
DirectInput only maps the keyboard, not every possible keystroke. There
are no DIK_KEY constants for masked keystrokes. DIK_ESCAPE simply refers
to the very top-left button on the keyboard, DIK_1 refers to the second
button on the second row. Etc..
You don't have to use DInput for keyboard handling though.
I didn't document it, but if you look in exoticaX.ew, you will find a
couple of routines for Windows keyboard handling. I use them in
guiX_dlg.ew for the edit controls.
Actually, I believe windows handles keystrokes the same way, but it's
alot more versatile.
I think you would encounter the same problem.
Chris
Martin Stachon wrote:
> But exclamation point isn't always shift+1. On my keyboard (Czech
> layout)
> it's on a different place. There must be another way to find out this...
>
> Martin
>
>
> > Yes, you are right. My example isn't exactly correct. You must poll each
> >
> > key in a seperate cycle of exotica. That's why you need the shift
> > variable.
> > here's a better example:
> >
> > -- SNIPPET --
> > while 1 do
> > if aActive()=1 then
> > dinput_update()
> > if keyboard_keystate(DIK_LSHIFT) or keyboard_keystate(DIK_RSHIFT) then
> > shift = 1
> > elsif shift and keyboard_keystate(DIK_1) then
> > -- EXCLAMATION PRESSED
> > end if
> > end if
> > if exotica_error() then exotica_abort(1) end if
> > end while
> > -- END --
> >
> > Chris
> >
> > C. K. Lester wrote:
> > > bensler at mail.com wrote:
> > > > shift = keyboard_keystate(DIK_LSHIFT) or
> > > > keyboard_keystate(DIK_RSHIFT)
> > > > if shift and keyboard_keystate(DIK_1) then
> > > > -- EXCLAMATION PRESSED
> > > > end if
> > >
> > > I thought it only returned one key unless you used the multi-key
> > > processing code... which I'm not using.
> > >
> > >
|
Not Categorized, Please Help
|
|