maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to in software press SDLKP_Enter but GET SDLK_Return (https://talk.maemo.org/showthread.php?t=27244)

tobiasj 2009-03-02 16:33

How to in software press SDLKP_Enter but GET SDLK_Return
 
I have been searching for some time this morning but since I am not really sure what I am searching for I dont know HOW to search for it.

I am trying to update the Atari800 emulator to work more properly on the N810, one of the big issues is the fact that the N810 keyboard return key sends KP_Enter and not K_Return (which is on the center button of the directional pad) the Atari 800 had no concept of a KP_Enter key and outputs a Atascii character to the screen instead of a return. So what I want to do (I assume) is either before launch of Atari800 change the keymapping that the N810 does so that the return key sends SDLK_Return (Xmodkey maybe?) or change the code of the emulator so that it intercepts the SDLKP_Enter and then handles it as if it were a SDLK_Return.

Neither of which I have any idea how to accomplish. Does anyone have any ideas I might try/butcher into working for this?

Thanks,

-John

TrueJournals 2009-03-03 04:39

Re: How to in software press SDLKP_Enter but GET SDLK_Return
 
Try this: In atari_sdl.c, find:
Code:

        case SDLK_RETURN:
                return AKEY_RETURN ^ shiftctrl;

And change it to:
Code:

        case SDLK_ENTER:
        case SDLK_RETURN:
                return AKEY_RETURN ^ shiftctrl;

If that doesn't work, try changing the same code to:
Code:

        case SDLK_ENTER:
                return AKEY_RETURN ^ shiftctrl;
        case SDLK_RETURN:
                return AKEY_RETURN ^ shiftctrl;

Not quite sure on the C syntax, and too lazy to look it up.

tobiasj 2009-03-03 14:11

Re: How to in software press SDLKP_Enter but GET SDLK_Return
 
You know, I thought along those lines, but convinced myself it couldn't be that easy.

I actually had to use this:

Code:

        case SDLK_KP_ENTER:
                return AKEY_RETURN ^ shiftctrl;
        case SDLK_RETURN:
                return AKEY_RETURN ^ shiftctrl;

Because they had to be seperate cases and it was SDK_KP_ENTER but it works perfectly.
I guess that will teach me that it really CAN be that easy. Thats what I like about these forums. I learn something new every day.

Thanks a ton for the info.

-John


All times are GMT. The time now is 13:04.

vBulletin® Version 3.8.8