Skip to content

Commit 9516be9

Browse files
author
Sebastien Bourdeauducq
committedNov 25, 2011
Keyboard shortcuts to switch between composite video sources: F1/F2/F3 to select green/blue/red inputs (respectively)
1 parent 1047f8b commit 9516be9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
 

‎src/gui/guirender.c

+21
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ static void adjust_contrast(int amount)
106106
cp_notify_changed();
107107
}
108108

109+
static void set_video_format(int new_format)
110+
{
111+
int format;
112+
113+
format = config_read_int("vin_format", VIDEO_FORMAT_CVBS6);
114+
if((format != VIDEO_FORMAT_CVBS6) && (format != VIDEO_FORMAT_CVBS5) && (format != VIDEO_FORMAT_CVBS4))
115+
return;
116+
config_write_int("vin_format", new_format);
117+
videoinreconf_request(VIDEO_SET_FORMAT, new_format);
118+
cp_notify_changed();
119+
}
120+
109121
static void input_cb(mtk_event *e, int count)
110122
{
111123
int i;
@@ -120,6 +132,15 @@ static void input_cb(mtk_event *e, int count)
120132
}
121133
if(e[i].type == EVENT_TYPE_PRESS) {
122134
switch(e[i].press.code) {
135+
case MTK_KEY_F1:
136+
set_video_format(VIDEO_FORMAT_CVBS6);
137+
break;
138+
case MTK_KEY_F2:
139+
set_video_format(VIDEO_FORMAT_CVBS5);
140+
break;
141+
case MTK_KEY_F3:
142+
set_video_format(VIDEO_FORMAT_CVBS4);
143+
break;
123144
case MTK_KEY_F5:
124145
adjust_brightness(5);
125146
break;

‎src/shortcuts.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void shortcuts_callback(mtk_event *e, int count)
7979
clean_shutdown(0);
8080
else if(ctrl && (e[i].press.code == MTK_KEY_F1))
8181
switch_resolution();
82-
else if(ctrl && (e[i].press.code == MTK_KEY_F2))
82+
else if(ctrl && (e[i].press.code == MTK_KEY_PAUSE))
8383
fbgrab(NULL);
8484
else if(e[i].press.code == MTK_KEY_F9) {
8585
f9_pressed = 1;

0 commit comments

Comments
 (0)