Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: thepenguin on July 18, 2013, 12:39:11 PM

Title: Input API
Post by: thepenguin on July 18, 2013, 12:39:11 PM
as far as I can tell, it processes keypresses and mouse clicks.  I found these functions:

GetKeyDown
GetMouseButtonDown
GetMouseCell

are there any others, and what do those do?
Title: Re: Input API
Post by: knucracker on July 18, 2013, 12:59:21 PM
I'll update the wiki in a couple hours.  Got to make a cinnabon run right fast, then I'll write them all up.  Look at TheBrain map for examples, though.
Title: Re: Input API
Post by: thepenguin on July 19, 2013, 06:39:30 AM
thanks a lot for documenting that!

is there any way to temporarily disable a user's hotkeys (while playing a certain map) so that you can use all the keys for crpl functions and not have to worry about what else they might be configured to do?

If you wanted them to type in an answer, for instance, the problem is that there are so many hotkeys that the keyboard is practically a minefield.
Title: Re: Input API
Post by: knucracker on July 19, 2013, 09:35:36 AM
Hmmm... yeah maybe. Let me look into that.

So what do you plan to do, make your own TextInput field in CRPL?  Load up images for every letter as custom images, then check for every key press and allow somebody to type (so you create dynamic sub images for each character)?  I've not thought about that till this moment, but I suppose that would be possible now... if a bit of a programming challenge.
Title: Re: Input API
Post by: thepenguin on July 19, 2013, 09:53:38 AM
Quote from: virgilw on July 19, 2013, 09:35:36 AM
Hmmm... yeah maybe. Let me look into that.

So what do you plan to do, make your own TextInput field in CRPL?  Load up images for every letter as custom images, then check for every key press and allow somebody to type (so you create dynamic sub images for each character)?  I've not thought about that till this moment, but I suppose that would be possible now... if a bit of a programming challenge.

That's the idea of it, though I may just use ShowMessage and save my images for other things, now that I think of it.  Images were the original plan.

I also realized that because everyone has custom hotkeys, I didn't want to have to deal with using a key that someone already has set to something else as a trigger for something.
Title: Re: Input API
Post by: thepenguin on July 20, 2013, 04:40:47 PM
Have you checked if the hotkey disable is possible?

Either a checkbox in the editor, or a CRPL function would be fine.
I don't know, but I assume it could be as simple as putting the code for attatching key handlers into an if statement, but I don't have access to the code, so IDK.
Title: Re: Input API
Post by: knucracker on July 20, 2013, 04:46:43 PM
Yeah, I added that yesterday actually.  I could probably roll a 7c build tonight if it is something you want right now.
Title: Re: Input API
Post by: thepenguin on July 20, 2013, 06:35:55 PM
Thanks, I could use that ASAP.