Basilisk II is an Open Source 68k Macintosh emulator.
Release notes from J.F.:
Here’s test 19. Updated the input mapping. Rules are as follows:
1 – You can have a maximum of 64 map entries.
2 – Map entries have two hexadecimal numbers followed by four decimal numbers.
3 – The first number is which PSP buttons must be pressed to match this map entry. The second number is which PSP buttons must NOT be pressed to match this map entry. Any combination is allowed. If you don’t specify all the buttons between the two fields, you can match to more than one entry (which is something you may want to do).
4 – The third through sixth numbers are Mac input values. They may be key codes, mouse buttons, or mouse movements. The following rules apply to Mac input values:
Anything less than 255 is a Mac key code. For the caps lock to work properly, it must be the first and only Mac input value for the map entry.
A value exactly equal to 255 is a null code – it does nothing. Be sure to fill unused values with 255!
A value between 256 and 511 is a mouse button, where the button number is the value – 256. So 256 is mouse button 0, 257 is mouse button 1, etc. Note that the 68K Mac never really used anything other than mouse button 0.
A value between 512 and 768 is a mouse movement. The movement is a value from -8 to +7 added to 8, with the horizontal movement being multiplied by 16. Negative values move up or left; positive values move down or right. So if you wished to move the mouse up at a speed of 2 and right at a speed of 5, the movement value would be 512 + (5+8)*16 + (-2+8), or 726. It might be easier to visualize it in hexadecimal, even if the value must be in the map as decimal. In hex, the mouse movement is 0x2XY, where X is the horizontal movement, and Y the vertical.
Notice that the mouse movement is new – I added that so that the d-pad could be used as a mouse if the analog stick weren’t working. I’ve included a new input map that makes the d-pad the mouse.
Note that the default mapping has changed! LTRIGGER is now the OPT key, and RTRIGGER the Control key. The CROSS is now the mouse button, while Enter was moved to SQUARE. The rest are the same as before: the d-pad is the Cursor keys, CIRCLE is CMD+w, and TRIANGLE is CMD+q.
This matches the d-pad mouse pretty well, where the d-pad becomes the mouse movement, and LTRIGGER changes from OPT to FAST mouse movement. So if you just press the d-pad, the mouse moves slowly, and if you hold LTRIGGER and press the d-pad, the mouse moves quickly.
Note that making RTRIGGER Control by itself was necessary to get contextual menus working right. Hold RTRIGGER, then press X over top something to get its contextual menu.
http://forums.ps2dev.org/viewtopic.php?t=3741&postdays=0&postorder=asc&start=540