mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 22:33:58 +00:00
[client] add new keybind to toggle the video stream (ScrLck+V)
This commit is contained in:
parent
46df25bb80
commit
757a90a643
3 changed files with 31 additions and 3 deletions
|
@ -44,6 +44,7 @@ Below are a list of current key bindings:
|
||||||
|-|-|
|
|-|-|
|
||||||
| <kbd>ScrLk</kbd> | Toggle cursor screen capture |
|
| <kbd>ScrLk</kbd> | Toggle cursor screen capture |
|
||||||
| <kbd>ScrLk</kbd>+<kbd>F</kbd> | Full Screen toggle |
|
| <kbd>ScrLk</kbd>+<kbd>F</kbd> | Full Screen toggle |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>V</kbd> | Video stream toggle |
|
||||||
| <kbd>ScrLk</kbd>+<kbd>I</kbd> | Spice keyboard & mouse enable toggle |
|
| <kbd>ScrLk</kbd>+<kbd>I</kbd> | Spice keyboard & mouse enable toggle |
|
||||||
| <kbd>ScrLk</kbd>+<kbd>N</kbd> | Toggle night vision mode (EGL renderer only!) |
|
| <kbd>ScrLk</kbd>+<kbd>N</kbd> | Toggle night vision mode (EGL renderer only!) |
|
||||||
| <kbd>ScrLk</kbd>+<kbd>Q</kbd> | Quit |
|
| <kbd>ScrLk</kbd>+<kbd>Q</kbd> | Quit |
|
||||||
|
|
|
@ -413,7 +413,7 @@ static int frameThread(void * unused)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(state.state == APP_STATE_RUNNING)
|
while(state.state == APP_STATE_RUNNING && !state.stopVideo)
|
||||||
{
|
{
|
||||||
LGMPMessage msg;
|
LGMPMessage msg;
|
||||||
if ((status = lgmpClientProcess(queue, &msg)) != LGMP_OK)
|
if ((status = lgmpClientProcess(queue, &msg)) != LGMP_OK)
|
||||||
|
@ -1147,6 +1147,29 @@ static void toggle_fullscreen(SDL_Scancode key, void * opaque)
|
||||||
params.fullscreen = !params.fullscreen;
|
params.fullscreen = !params.fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void toggle_video(SDL_Scancode key, void * opaque)
|
||||||
|
{
|
||||||
|
state.stopVideo = !state.stopVideo;
|
||||||
|
app_alert(
|
||||||
|
LG_ALERT_INFO,
|
||||||
|
state.stopVideo ? "Video Stream Disabled" : "Video Stream Enabled"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (state.stopVideo)
|
||||||
|
state.lgr->on_restart(state.lgrData);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (t_frame)
|
||||||
|
{
|
||||||
|
lgJoinThread(t_frame, NULL);
|
||||||
|
t_frame = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!lgCreateThread("frameThread", frameThread, NULL, &t_frame))
|
||||||
|
DEBUG_ERROR("frame create thread failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void toggle_input(SDL_Scancode key, void * opaque)
|
static void toggle_input(SDL_Scancode key, void * opaque)
|
||||||
{
|
{
|
||||||
state.ignoreInput = !state.ignoreInput;
|
state.ignoreInput = !state.ignoreInput;
|
||||||
|
@ -1208,6 +1231,7 @@ static void ctrl_alt_fn(SDL_Scancode key, void * opaque)
|
||||||
static void register_key_binds()
|
static void register_key_binds()
|
||||||
{
|
{
|
||||||
state.kbFS = app_register_keybind(SDL_SCANCODE_F , toggle_fullscreen, NULL);
|
state.kbFS = app_register_keybind(SDL_SCANCODE_F , toggle_fullscreen, NULL);
|
||||||
|
state.kbVideo = app_register_keybind(SDL_SCANCODE_V , toggle_video , NULL);
|
||||||
state.kbInput = app_register_keybind(SDL_SCANCODE_I , toggle_input , NULL);
|
state.kbInput = app_register_keybind(SDL_SCANCODE_I , toggle_input , NULL);
|
||||||
state.kbQuit = app_register_keybind(SDL_SCANCODE_Q , quit , NULL);
|
state.kbQuit = app_register_keybind(SDL_SCANCODE_Q , quit , NULL);
|
||||||
state.kbMouseSensInc = app_register_keybind(SDL_SCANCODE_INSERT, mouse_sens_inc , NULL);
|
state.kbMouseSensInc = app_register_keybind(SDL_SCANCODE_INSERT, mouse_sens_inc , NULL);
|
||||||
|
@ -1229,9 +1253,10 @@ static void register_key_binds()
|
||||||
|
|
||||||
static void release_key_binds()
|
static void release_key_binds()
|
||||||
{
|
{
|
||||||
app_release_keybind(&state.kbFS);
|
app_release_keybind(&state.kbFS );
|
||||||
|
app_release_keybind(&state.kbVideo);
|
||||||
app_release_keybind(&state.kbInput);
|
app_release_keybind(&state.kbInput);
|
||||||
app_release_keybind(&state.kbQuit);
|
app_release_keybind(&state.kbQuit );
|
||||||
app_release_keybind(&state.kbMouseSensInc);
|
app_release_keybind(&state.kbMouseSensInc);
|
||||||
app_release_keybind(&state.kbMouseSensDec);
|
app_release_keybind(&state.kbMouseSensDec);
|
||||||
for(int i = 0; i < 12; ++i)
|
for(int i = 0; i < 12; ++i)
|
||||||
|
|
|
@ -53,6 +53,7 @@ enum WarpState
|
||||||
struct AppState
|
struct AppState
|
||||||
{
|
{
|
||||||
enum RunState state;
|
enum RunState state;
|
||||||
|
bool stopVideo;
|
||||||
bool ignoreInput;
|
bool ignoreInput;
|
||||||
bool escapeActive;
|
bool escapeActive;
|
||||||
SDL_Scancode escapeAction;
|
SDL_Scancode escapeAction;
|
||||||
|
@ -112,6 +113,7 @@ struct AppState
|
||||||
bool resizeDone;
|
bool resizeDone;
|
||||||
|
|
||||||
KeybindHandle kbFS;
|
KeybindHandle kbFS;
|
||||||
|
KeybindHandle kbVideo;
|
||||||
KeybindHandle kbInput;
|
KeybindHandle kbInput;
|
||||||
KeybindHandle kbQuit;
|
KeybindHandle kbQuit;
|
||||||
KeybindHandle kbMouseSensInc;
|
KeybindHandle kbMouseSensInc;
|
||||||
|
|
Loading…
Reference in a new issue