Notices


Reply
Thread Tools
Posts: 1,042 | Thanked: 430 times | Joined on May 2010
#31
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++
 
Posts: 8 | Thanked: 5 times | Joined on Nov 2011
#32
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.
 
Posts: 1,042 | Thanked: 430 times | Joined on May 2010
#33
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); 

Last edited by Radicalz38; 2011-11-18 at 04:54.
 
Posts: 8 | Thanked: 5 times | Joined on Nov 2011
#34
Its worth a try I suppose. Also the enter key is hard coded to be Select. Does the n900 have that?
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#35
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
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 
Posts: 8 | Thanked: 5 times | Joined on Nov 2011
#36
I have enter mapped to return.

Code:
Keyboard::KeyType Keyboard::Key_ENTER = SDLK_RETURN;
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#37
Generally, please avoid hardcoding remapping something into port - this break compatibility with external (USB, Bluetooth) keyboards, or with user-preferred keymap (hardware remapping).

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 
Posts: 8 | Thanked: 5 times | Joined on Nov 2011
#38
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.
 
Reply


 
Forum Jump


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