1. RE: Exotica X keyboard events

I'm not quite sure I understand what you want to do.

I've had some trouble with figuring out how to use the keyboard 
routines, but I always seemed to figure it out, so I suspect that you 
can do what you want.

>From what I understand, you are using buffered mode, and want to return 
the entire contents of the key buffer all at once.

you can use get_kb_buffer_events() to get the number of pending keyboard 
events.

Knowing that, you can make a loop to retrieve the actual events, using 
get_kb_buffer_data().

Unfortunately, there is no routine for returning the entire buffer at 
once.

You will still have to compare each event individually, but you could 
use find() to search for a specific keypress within your buffer 
sequence, instead of polling the loop.

I've been meaing to add some routines to assist with keyboard handling 
:/

HTH
Chris

Lewis Townsend wrote:
> Hello all, Chris Bensler,
> 
> I am currently working on my LAGUI for exoticaX and am trying to make an 
> 
> editable text box. However, I need more access to the keyboard buffer 
> than 
> ExoticaX seems to provide. What I'd like to do is just return the DX kb 
> buffer into an Euphoria sequence. Lacking that, could I at least want 
> find 
> out what each event is rather than guessing. According to the 
> documentation, 
> the only thing I can do with buffered kb data is use 
> get_kb_buffer_data() to 
> find out if a specific key I passed it is the same as the one in that 
> specific slot of the buffer. It doesnt tell me if I'm warm or cold; if I 
> 
> need to go up or down, just a yes or no. I would have to loop through 
> each 
> key on the keyboard, for each event in the buffer to find out what was 
> actually pressed and when.
> Can you help me with this Chris? Is the functionality I'm looking for 
> already there (just not documented) or do you or Todd need to add a 
> function 
> somewhere?
> 
> thanks for your time,
> Lewis Townsend
> 
>

new topic     » topic index » view message » categorize

2. RE: Exotica X keyboard events

Hello Chris,

Thanks for the reply.

> >From what I understand, you are using buffered mode,

Yes

>Knowing that, you can make a loop to retrieve the actual events, using
>get_kb_buffer_data().

Thats the trouble, according to the Documentation that I have, it doesn't 
work that way. get_kb_buffer_data() has 2 parameters, event and key. event 
is the element of the buffer; ok there. the "key" is the key press you are 
looking for, so you have to know what you are looking for, you just cant ask 
it to return what it has. The return value is just true or false: true if 
you guessed the right key, false if that key isn't in that event. Again, 
this is just according to the docs and I assume its correct. ?

I guess I could experiment with the function and do stuff like pass 0 or -1 
to "key" and see if get_kb_buffer_data() will return a key code rather than 
just a true 1 or false 0.

later,
Lewis Townsend

new topic     » goto parent     » topic index » view message » categorize

3. RE: Exotica X keyboard events

I see what yer getting at. You are right. get_kb_buffer_data() only 
returns T or F.

The keyboard input system in exotica is something to be desired, I'm 
afraid. No matter how you slice it, you can only poll for a specific 
keypress, in either kb mode.

I have been planning to make a routine to assist with this, but it's 
still not a very good alternative.

The only way I can think of to get the entire buffer, is to check for 
each allowable key, in all pending events.

The best idea, would be to disable DX kb input, and use windows kb event 
handling.


Chris


Lewis Townsend wrote:
> Hello Chris,
> 
> Thanks for the reply.
> 
> > >From what I understand, you are using buffered mode,
> 
> Yes
> 
> >Knowing that, you can make a loop to retrieve the actual events, using
> >get_kb_buffer_data().
> 
> Thats the trouble, according to the Documentation that I have, it 
> doesn't 
> work that way. get_kb_buffer_data() has 2 parameters, event and key. 
> event 
> is the element of the buffer; ok there. the "key" is the key press you 
> are 
> looking for, so you have to know what you are looking for, you just cant 
> ask 
> it to return what it has. The return value is just true or false: true 
> if 
> you guessed the right key, false if that key isn't in that event. Again, 
> 
> this is just according to the docs and I assume its correct. ?
> 
> I guess I could experiment with the function and do stuff like pass 0 or 
> -1 
> to "key" and see if get_kb_buffer_data() will return a key code rather 
> than 
> just a true 1 or false 0.
> 
> later,
> Lewis Townsend
> 
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu