Main > Software Forum

Looking for Modified Emulators : Esc key friendly

<< < (2/3) > >>

jcrouse:
I am curious as to how the dev's do this. I have written apps with keyboard hooks, some of my wrappers, but it just seems like it would be inefficient if the FE is monitoring all the keypress or keydown events looking for the ESC key. Wouldn't you think this would effect input speed (minor lag) for the emulator.

John

swindus:
MaLa uses two different methods to do this:

1. A system hook which catch one defined key and close the running process (emu) like your wrappers.

2. Windows hotkeys. With this method MaLa can convert pressed keys to other keys like ESC -> Alt + X for example or terminate the process or just catch the pressed key so that it never reach the emulator.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/cerefwm_hotkey.asp

I never noticed any negative effects on input speed with this methods so far. Maybe it depends on the used emulator.

headkaze:
GameEx can also use ESC to kill an emu. I have written system wide keyboard hooks myself and it dosn't effect the speed of the emu because you don't need to poll the input at 100% CPU usage. You can sleep() for as long as you want after checking for a keypress and it won't effect the emu. It depends on how you code it I suppose.

BTW You can often re-map keys in an emu's exe using Resource Hacker. For example in VisualBoy advance you can map exit to the ESC key and change menu to ENTER.

Eg.

--- Code: ---VK_ESCAPE, 40002, NOINVERT, VIRTKEY
VK_RETURN, 40263, NOINVERT, VIRTKEY
--- End code ---

jcrouse:

--- Quote from: headkaze on September 05, 2006, 08:58:37 pm ---GameEx can also use ESC to kill an emu. I have written system wide keyboard hooks myself and it dosn't effect the speed of the emu because you don't need to poll the input at 100% CPU usage. You can sleep() for as long as you want after checking for a keypress and it won't effect the emu. It depends on how you code it I suppose.

BTW You can often re-map keys in an emu's exe using Resource Hacker. For example in VisualBoy advance you can map exit to the ESC key and change menu to ENTER.

Eg.

--- Code: ---VK_ESCAPE, 40002, NOINVERT, VIRTKEY
VK_RETURN, 40263, NOINVERT, VIRTKEY
--- End code ---

--- End quote ---

I realize this was just an example, but just an FYI, I believe, buriend in the menu's, you can change EVERY key input for Visualboy Advance. I know you can on the knock-offs such as smoth_vba.

John

Howard_Casto:

--- Quote from: headkaze on September 05, 2006, 08:58:37 pm ---GameEx can also use ESC to kill an emu. I have written system wide keyboard hooks myself and it dosn't effect the speed of the emu because you don't need to poll the input at 100% CPU usage. You can sleep() for as long as you want after checking for a keypress and it won't effect the emu. It depends on how you code it I suppose.


--- End quote ---

But is it an external app or gameex itself that is doing it?  Because if gameex is running, even with sleep, all of the resources (including memory space) are still there taking up space.  That is unless you are doing it some way I don't know of. 

That's why we normally use the wrappers.  They have to be resident too, but they are tiny little apps, so they don't take up much space. 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version