maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Games (https://talk.maemo.org/forumdisplay.php?f=12)
-   -   Paintown : A fighting game engine like MUGEN [Working on the N900!] (https://talk.maemo.org/showthread.php?t=79910)

Radicalz38 2011-11-18 01:18

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
Thanks jon! Hmm Could you point me out on what file does the paintown main menu get it's key mappings? I'm not really good at c++ :p

jon5 2011-11-18 04:03

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
Well actually its very strange that mugen would work but the paintown menu wouldn't work because in fact they use almost identical code.

For mugen look src/mugen/util.h on line 255 in getPlayer1Keys() is:
Code:

input.set(Configuration::config(0).getAttack1(), delay, false, Mugen::A);
Which basically gets the current attack key for configuration 0 (which is player 1) and assigns it to the Mugen::A logical key.

The paintown menu does a similar thing in src/menu/menu.cpp on line 1382
Code:

input.set(Configuration::config(0).getAttack1(), 0, true, Select);
It gets the same attack key from configuration 0 and assigns it to the menu key Select.

(The difference between 'Select' and 'Mugen::A' is completely irrelevant, they are just names)

Just as a test can you try pressing every single key on the n900 to prove that none of them do anything? If any key has some effect then please list what key it was and what effect it had here.

Radicalz38 2011-11-18 04:49

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
Hi!

Up arrow key = Up
Down arrow key = Down

J key = Up
K key = Down

That's just it. But with mugen(while playing) all keys word fine I get 4 attack keys working. with up left down right


Also what would happen if I change it/add

PHP Code:

input.set(Keyboard::Key_A0trueSelect); 

:confused:

jon5 2011-11-18 05:30

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
Its worth a try I suppose. Also the enter key is hard coded to be Select. Does the n900 have that?

Estel 2011-11-18 05:36

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
N900 enter is perceived by software as KP_Return.

It's possible to remap hardware keyboard to have Enter as - for example - shift + enter, but I have no idea if it would work (should, but only way to check it is to try).

/Estel

jon5 2011-11-18 17:08

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
I have enter mapped to return.

Code:

Keyboard::KeyType Keyboard::Key_ENTER = SDLK_RETURN;

Estel 2011-11-18 17:30

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
Generally, please avoid hardcoding remapping something into port - this break compatibility with external (USB, Bluetooth) keyboards, or with user-preferred keymap (hardware remapping).

/Estel

jon5 2011-11-18 18:28

Re: Paintown : A fighting game engine like MUGEN [Working on the N900!]
 
SDL will translate OS mapped keys to an internal representation, at least thats my understanding.

In SDL, src/video/x11/SDL_x11events.c is a procedure named X11_TranslateKeycode which calls
Code:

xsym = XKeycodeToKeysym(display, kc, 0);
Which will read the global key mapping from X11.

Thus the SDL key mapping is a layer of abstraction above the OS and not a direct mapping to the hardware.


All times are GMT. The time now is 15:59.

vBulletin® Version 3.8.8