Fixed ALT mode key by using BIT mask for two Keys: KEY_UP + KEY_LEFT. This means user has to press both buttons to enter CHDK.
kbd.c
// Base values in Play Mode
// physw_status[0] = 0x800C91F // 1
// physw_status[1] = 0xFFE // 2 (Mode Switch: Auto)
// physw_status[2] = 0x400000 // 3
// Mode Switch:
// physw_status[1] 0x1 Auto
// physw_status[1] 0x0 Photo
// physw_status[1] 0x2 Video
// physw_status[2] 0x20000 SD-Card READONLY
static KeyMap keymap[] = {
{ 0, KEY_UP , 0x00000004 },
{ 0, KEY_DOWN , 0x00000001 },
{ 0, KEY_LEFT , 0x00000008 },
{ 0, KEY_RIGHT , 0x00000002 },
{ 1, KEY_SET , 0x00000040 },
{ 0, KEY_SHOOT_FULL , 0x00000800 },
{ 0, KEY_SHOOT_HALF , 0x00000100 },
{ 1, KEY_ZOOM_IN , 0x00000010 },
{ 1, KEY_ZOOM_OUT , 0x00000020 },
{ 1, KEY_MENU , 0x00000080 },
{ 0, KEY_PRINT , 0x0000000C }, // ALT Key workaround: KEY_UP + KEY_LEFT (camera has no print key)
{ 0, 0, 0 }
};
This also means theres no need for alt_mode_key_mask.
Still canon firmware has redraw issus sometimes before and after ALT mode (redraw recovers after some seconds most of the time).