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


Leave a Reply

Your email address will not be published. Required fields are marked *