Modifying Inkey

Posted By: Vorick

Modifying Inkey - 03/03/09 06:46

Good Morning,

I'd like to ask if there is any way to redefine the inkey events, e.g. "Cursor Down" aborts the input and restores the original string. How can I keep the string on "Cursor Down"?

I guess I could just copy the inkey string to a backup string and then restore it manually after cursor down is pressed, but that doesn't seem very feasible.

I also thought about programming my own pseudo-inkey function with on_anykey, but if there's a way to avoid it, I'd be glad to hear about it.

Patrick
Posted By: Pappenheimer

Re: Modifying Inkey - 03/03/09 17:42

You could re-activate inkey, when pressing Cursor Down like this:

if(key_cud){while(){wait(1);} inkey_active = 1;}

Didn't test it. If this is sufficient, depends also on your other needs.
Posted By: Vorick

Re: Modifying Inkey - 03/04/09 11:26

Thanks for the hint. I'll look into it.

As of now I think I really need my own version of inkey since I plan to use improved chat features like quest linking and the likes.
Posted By: Ottawa

Re: Modifying Inkey - 03/05/09 00:19

Hi!

Look up in_key...you can cancel with a "if"
Quote:

1 Input terminated prematurely because inkey_active was set to 0 or another keyboard entry was active at the same time.
9 Input terminated by [Tab]
13 Input terminated by [Enter]
27 Input aborted by [Esc]
72 Input aborted by [Up]
73 Input aborted by [PgUp]
80 Input aborted by [Down]
81 Input aborted by [PgDn]


Ottawa smile
© 2024 lite-C Forums