Category: Engine Keymaps

AGOS Engine – Week 2

DISCLAIMER: I had my exams for a week, hence I could not make sufficient progress

After my previous commit my mentors had made me realize that I did not take into account the game controller players. My keymaps would not identify controller key binds. Below review shows that I had made these two major errors, rest were small like naming conventions etc.

I was able to insert the yes/no option easily into the keymap. But the issue arose on how could we check if any of the controller key binds have been pressed. First I tried to loop through the const HardwareInputTableEntry defaultJoystickButtons[] and add all button into the keyMap action but I was advised that it is not the right way as it would look too cluttered when keyMap is accessed by the user. As of Saturday I am still stuck at this and hopefully I will be able to come up with a solution by the end of the day as next week I have to focus on another engine.

PR: Github

AGOS Engine – Week 1

The easiest way to start identifying where you need to replace the Enum values is to search the word “key” in that project. This way you can narrow down which files you have to go through.

Now in terms of how to define keymaps, there is initial documentation available in ScummVM website. But that won’t be enough to start, it is important to look through previous commits in ScummVM github to find similarities in the current engine in which keymap is being integrated. This is how I identified the keys and made initial keymap, I divided the keymaps into two, Engine(AGOS) Keymap and Game keymap. Engine Keymap contains key bindings which are same throughout the all the games of that engine and Game keymaps are specific to that engine.

 

There were two issues I faced, in the previous commits when they were adding custom key binds, they would usually customize or replace Event object based methods for example here. But AGOS engine in most places did not use event.type to identify key binds, rather it used _keyPressed.keycode, but there was a solution, I searched previous commits thoroughly and thankfully I found SKY engine commit which would track EnumAction _action and then make necessary changes to it.

Another issue I ran into was that after I had completed my keybind was that my method wouldn’t take continuous input when key was held down, The mistake I was doing was I would reset the –
   _action = kActionNone
each time after the keys were processed, instead I should’ve  reset it when
   event.type == EVENT_CUSTOM_ENGINE_ACTION_END.
Hence, that solved the problem.

My Commit: AGOS: Add keymapper support