ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > iPhone Port > quick hack to make games that require arrow keys playable
quick hack to make games that require arrow keys playable
  Author    Thread Reply to topic
donkthemagicllama



Joined: 15 Nov 2017
Posts: 3
quick hack to make games that require arrow keys playable 

If you want to play a game like Black Cauldron that absolutely needs arrow keys (e.g. to select inventory items), here's a quick and dirty hack.

I don't have time to submit a PR right now, but maybe this can help someone..

It remaps the following keys to be a set of arrow keys (if you look at the layout of these keys on the iPhone keyboard, you'll see its roughly equivalent to WASD):

] = UP
\ = DOWN
_ = LEFT
| = RIGHT

you can't press and hold, but it's good enough for my situation, hopefully yours too... I left the ascii set to F1 in there, as it doesn't seem to work otherwise... there's probably a good reason for this, and a better way to do it, but I haven't messed with it that much yet.

in the file backends/platform/ios7/ios7_osys_events.cpp
add the following cases to the switch statement at line 388:


code:

    case 93:
        keyPressed = Common::KEYCODE_UP;
        ascii = Common::ASCII_F1;
        break;
    case 92:
        keyPressed = Common::KEYCODE_DOWN;
        ascii = Common::ASCII_F1;
        break;
    case 95:
        keyPressed = Common::KEYCODE_LEFT;
        ascii = Common::ASCII_F1;
        break;
    case 124:
        keyPressed = Common::KEYCODE_RIGHT;
        ascii = Common::ASCII_F1;
        break;



 Reply with quote  
Post Thu Nov 23, 2017 8:56 pm 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 



Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge