Page 1 of 2

Remap Key Question

PostPosted: Sat Feb 04, 2006 5:43 pm
by plinydogg
I can't seem to figure out how to properly use the remapKey() function. Can anyone help?

Here's what I am currently doing (which isn't working):

(1) User presses "remap keys" on the main menu and the view moves to a separate remapping screen;

(2) The user is told to press the key that he or she wants to perform the listed function (for example, when the word "main gun" is displayed, the user is supposed to press the button he/she wants to use to fire the main gun, etc.);

(3) The user then presses a button that says "remap" and the following code is executed:

remapKey(getLastKey(), KEY_POCKET_C);

(4) The user hits the return button to return to the main screen.

I can't figure out why this doesn't work. Is it because I have to use a keydown event? If so, what actor should I put it on?

Thanks in advance for the help.

Plinydogg

PostPosted: Sat Feb 04, 2006 6:28 pm
by Novice
I think that remapKey(); function doesent work with PPC, sombodey correct me if im wrong.

Re: Remap Key Question

PostPosted: Sat Feb 04, 2006 9:27 pm
by makslane
plinydogg wrote:The user then presses a button that says "remap" and the following code is executed:

remapKey(getLastKey(), KEY_POCKET_C);


The pocket pc keys are special keys (you don't have a pocket pc key in your keyboard!).
So, you need assign a usal PC key to the pocket pc key in the Game Properties panel.

PostPosted: Sat Feb 04, 2006 9:28 pm
by makslane
Novice wrote:I think that remapKey(); function doesent work with PPC, sombodey correct me if im wrong.


The remapKey() function works on Pocket PC too!

PostPosted: Sat Feb 04, 2006 10:02 pm
by plinydogg
Thanks for the replies.

Sorry to be dense, but when you say that I "need assign a usal PC key to the pocket pc key in the Game Properties panel," what do you mean exactly?

Do you mean that I need to, for example, remap POCKET_KEY_C to, say, KEY_RCTRL in the Game Properties panel and then use the remapKey() function?

Thanks again for the help!

PostPosted: Sat Feb 04, 2006 10:24 pm
by Novice
If you want to test on your PC yes, for the exporeted game use whatever you are using now.

PostPosted: Sat Feb 04, 2006 10:54 pm
by plinydogg
But if that's true, then why don't the steps I outlined in the original post work properly?

PostPosted: Sun Feb 05, 2006 12:41 am
by makslane
plinydogg wrote:Do you mean that I need to, for example, remap POCKET_KEY_C to, say, KEY_RCTRL in the Game Properties panel and then use the remapKey() function?


Use the configuration in Game Properties to map a pocket pc key to a valid key in your PC keyboard. Note, when you use the Key Down/Up event, you can only use PC keys.

PostPosted: Tue Feb 07, 2006 4:17 pm
by plinydogg
Alright...I've tried everything I can think of to implement key remapping in my PPC game without success. The whole purpose of doing this is because a betatester reported that a couple of the keys did not perform their intended function on his/her device. To fix this, I wanted to allow the user to remap the keys so that it would work on all PPC devices.

I'm sure that someone has implemented this before in some game. If so, I would REALLY appreciate it if you would post a brief explanation of how you went about doing so. Alternatively, you can e-mail me at plinydogg@aol.com.

Thanks.

PostPosted: Wed Feb 08, 2006 2:56 am
by mrdark7734
I made a demo about this very subject after I ran into the problem while making "A Bloody Mess"
I'll post the GE files as soon as I get a chance, unfortunatly that won't be until this weekend as I'm not able to get at my normal computer.
The demo has the ability to remap every button available to GE for pocket pc as well as save the configuration to a file, and it does it very reliably.
If you want to see it in action download the demo for "A Bloody Mess"
I'll try and post the GE files saturday if I can.

PostPosted: Wed Feb 08, 2006 4:57 pm
by plinydogg
Thank you mrdark7734! I would really appreciate it! And I'm sure that others will find it useful as well.

PostPosted: Wed Feb 08, 2006 5:53 pm
by Mardi-Gras
A second vote of appreciation from me - I'd also find that of interest. My blood ran slightly cold when reading Plinydogg's original post, as remapping wasn't a difficulty I'd anticipated, but I can see how it could cause problems. Hope you can find the time to post your tutorial, and many thanks in advance. As Plinydogg said, I think alot of people'd find it useful.

PostPosted: Thu Feb 09, 2006 1:12 am
by plinydogg
mrdark7734,

Two things: (1) I downloaded the demo to "A Bloody Mess" from Handango but wasn't able to find an option that allows the user to reconfigure buttons: and (2) The game is REALLY FUN AND ADDICTIVE!!! Nice work!

Plinydogg

PostPosted: Thu Feb 09, 2006 3:18 am
by mrdark7734
Sorry about that, the configuration screen is available in the VGA version of the demo only (I forgot I had two versions. If my head wasn't stapled on I'd loose it)

And thank you for the compliment.

PostPosted: Thu Feb 09, 2006 10:42 pm
by plinydogg
mrdark7734:

While waiting on your button remap demo, I wrote a review of A Bloody Mess.....check it out:

http://ppcgems.blogspot.com/