kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Pi Firmware: added keymap property with default 123233
Change-Id: I749fd3e7ec62544b46b6c46d01463ba6c155d741pull/11/head
rodzic
d6819a323a
commit
11f728c7e9
74
src/osd.c
74
src/osd.c
|
@ -362,6 +362,14 @@ static int palette = PALETTE_DEFAULT;
|
|||
// Currently selected input mux setting
|
||||
static int mux = 0;
|
||||
|
||||
// Keymap
|
||||
static int key_enter = OSD_SW1;
|
||||
static int key_menu_up = OSD_SW2;
|
||||
static int key_menu_down = OSD_SW3;
|
||||
static int key_value_dec = OSD_SW2;
|
||||
static int key_value_inc = OSD_SW3;
|
||||
static int key_cal = OSD_SW3;
|
||||
|
||||
// =============================================================
|
||||
// Private Methods
|
||||
// =============================================================
|
||||
|
@ -762,31 +770,24 @@ void osd_key(int key) {
|
|||
switch (osd_state) {
|
||||
|
||||
case IDLE:
|
||||
switch (key) {
|
||||
case OSD_SW1:
|
||||
if (key == key_enter) {
|
||||
// Enter
|
||||
osd_state = MENU;
|
||||
current_menu[depth] = &main_menu;
|
||||
current_item[depth] = 0;
|
||||
redraw_menu();
|
||||
break;
|
||||
case OSD_SW2:
|
||||
// NOOP
|
||||
break;
|
||||
case OSD_SW3:
|
||||
} else if (key == key_cal) {
|
||||
// Auto Calibration
|
||||
osd_set(0, ATTR_DOUBLE_SIZE, "Auto Calibration");
|
||||
action_calibrate();
|
||||
delay();
|
||||
osd_clear();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case MENU:
|
||||
type = item->type;
|
||||
switch (key) {
|
||||
case OSD_SW1:
|
||||
if (key == key_enter) {
|
||||
// ENTER
|
||||
switch (type) {
|
||||
case I_MENU:
|
||||
|
@ -822,34 +823,29 @@ void osd_key(int key) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case OSD_SW2:
|
||||
} else if (key == key_menu_up) {
|
||||
// PREVIOUS
|
||||
if (current_item[depth] == 0) {
|
||||
while (current_menu[depth]->items[current_item[depth]] != NULL)
|
||||
current_item[depth]++;
|
||||
}
|
||||
current_item[depth]--;
|
||||
break;
|
||||
case OSD_SW3:
|
||||
} else if (key == key_menu_down) {
|
||||
// NEXT
|
||||
current_item[depth]++;
|
||||
if (current_menu[depth]->items[current_item[depth]] == NULL) {
|
||||
current_item[depth] = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
redraw_menu();
|
||||
break;
|
||||
|
||||
case PARAM:
|
||||
type = item->type;
|
||||
switch (key) {
|
||||
case OSD_SW1:
|
||||
if (key == key_enter) {
|
||||
// ENTER
|
||||
osd_state = MENU;
|
||||
break;
|
||||
case OSD_SW2:
|
||||
} else if (key == key_value_dec) {
|
||||
// PREVIOUS
|
||||
val = get_param(param_item);
|
||||
if (val == param_item->param->min) {
|
||||
|
@ -858,8 +854,7 @@ void osd_key(int key) {
|
|||
val--;
|
||||
}
|
||||
set_param(param_item, val);
|
||||
break;
|
||||
case OSD_SW3:
|
||||
} else if (key == key_value_inc) {
|
||||
// NEXT
|
||||
val = get_param(param_item);
|
||||
if (val == param_item->param->max) {
|
||||
|
@ -868,19 +863,15 @@ void osd_key(int key) {
|
|||
val++;
|
||||
}
|
||||
set_param(param_item, val);
|
||||
break;
|
||||
}
|
||||
redraw_menu();
|
||||
break;
|
||||
|
||||
case INFO:
|
||||
switch (key) {
|
||||
case OSD_SW1:
|
||||
if (key == key_enter) {
|
||||
// ENTER
|
||||
osd_state = MENU;
|
||||
osd_clear();
|
||||
redraw_menu();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1052,6 +1043,37 @@ void osd_init() {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Properties below this point are not updateable in the UI
|
||||
prop = get_cmdline_prop("keymap");
|
||||
if (prop) {
|
||||
int i = 0;
|
||||
while (*prop) {
|
||||
int val = (*prop++) - '1' + OSD_SW1;
|
||||
if (val >= OSD_SW1 && val <= OSD_SW3) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
key_enter = val;
|
||||
break;
|
||||
case 1:
|
||||
key_menu_up = val;
|
||||
break;
|
||||
case 2:
|
||||
key_menu_down = val;
|
||||
break;
|
||||
case 3:
|
||||
key_value_dec = val;
|
||||
break;
|
||||
case 4:
|
||||
key_value_inc = val;
|
||||
break;
|
||||
case 5:
|
||||
key_cal = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
// Disable CPLDv2 specific features for CPLDv1
|
||||
if (((cpld->get_version() >> VERSION_MAJOR_BIT) & 0x0F) < 2) {
|
||||
features[F_DEINTERLACE].max = DEINTERLACE_MA4;
|
||||
|
|
|
@ -134,10 +134,21 @@
|
|||
# - 0 is mode 7 detection on
|
||||
# - 1 is mode 7 detection off
|
||||
#
|
||||
# keymap: specifies which keys invoke which actions
|
||||
# - The default is 123233
|
||||
# - The individual digits numbers correspond to the following actions:
|
||||
# - key_enter
|
||||
# - key_menu_up
|
||||
# - key_menu_down
|
||||
# - key_value_dec
|
||||
# - key_value_inc
|
||||
# - key_cal
|
||||
# - Key SW1 is 1, key SW2 is 2, etc
|
||||
#
|
||||
# Important: All the properties must be on a single line, and no blank lines!
|
||||
#
|
||||
# Here's a good default for a Beeb or Master
|
||||
sampling06=3 sampling7=0,2,2,2,2,2,2,0 info=1 palette=0 deinterlace=1 scanlines=0 mux=0 elk=0 vsync=0 pllh=0 nbuffers=2 debug=0 m7disable=0
|
||||
sampling06=3 sampling7=0,2,2,2,2,2,2,0 info=1 palette=0 deinterlace=1 scanlines=0 mux=0 elk=0 vsync=0 pllh=0 nbuffers=2 debug=0 m7disable=0 keymap=123233
|
||||
#
|
||||
# Here's a example showing no oversampling in Mode 0..6
|
||||
# sampling06=0,4,4,4,4,4,4,2 geometry06=37,28,80,256,640,512 info=1 palette=0 deinterlace=1 scanlines=0 mux=0 elk=0 vsync=0 pllh=0 nbuffers=2 debug=1 m7disable=0
|
||||
|
|
Ładowanie…
Reference in New Issue