I'm browsing source code and I've found that in patch posted by quid at the very beginning of this port there is part:
+static KeyMap keymap[] = {
+ // Order IS important. kbd_get_pressed_key will walk down this table
+ // and take the first matching mask. Notice that KEY_SHOOT_HALF is
+ // always pressed if KEY_SHOOT_FULL is. --MarcusSt
+ //{ 0, KEY_FLASH , 0x80000000 },
+ { 2, KEY_MENU , 0x00002000 },
+ { 2, KEY_UP , 0x00000100 },
+ { 2, KEY_DOWN , 0x00000200 },
+ { 2, KEY_LEFT , 0x00000800 },
+ { 2, KEY_RIGHT , 0x00000400 },
+ { 2, KEY_SET , 0x00001000 },
+ // { 1, KEY_FACE , 0x10000000 },
+ { 1, KEY_PRINT , 0x10000000 }, // Face -> Print
+ { 2, KEY_ERASE , 0x00008000 },
+ { 2, KEY_DISPLAY , 0x00004000 },
+ { 2, KEY_ZOOM_IN , 0x00000010 },
+ { 2, KEY_ZOOM_OUT , 0x00000020 },
+ { 2, KEY_SHOOT_FULL, 0x0000000C },
+ { 2, KEY_SHOOT_HALF, 0x00000004 },
+ { 0, 0, 0 }
+};
How the adresses of buttons can be found? Do I have disassemble the firmware or can I do this some way by memory browser? I like to find adresses of controll dial (wheel on the back) to add script command like:
is_key k "wheel_left"
is_key j "wheel_right"
I've found that in quid's patch there was Get_JogDial function defined and there was an adress 0xC0240104. Can I simple add this to the KeyMap as for example WHEEL and then add this to script.c?
Also I can see, that there is only one adress in Get_JogDial and get_jogdial_direction is needed to check, if the wheel turns left or right. How can/should I use this value to add check in script if the wheel is turning left or right?
And another idea:
-could I simple peek value from 0xC0240104 by lua? This would be even better, since no source-code changes I need.
EDIT
After a few experiments the lastest idea works nice. I'll post something more when it'll be ready.