diff --git a/client/SDL/CMakeLists.txt b/client/SDL/CMakeLists.txt
index 234d55b5c..6d2b778c5 100644
--- a/client/SDL/CMakeLists.txt
+++ b/client/SDL/CMakeLists.txt
@@ -62,6 +62,14 @@ endif()
find_package(SDL2 REQUIRED COMPONENTS)
include_directories(${SDL2_INCLUDE_DIR})
include_directories(${SDL2_INCLUDE_DIRS})
+find_package(cJSON)
+
+set(LIBS "")
+if (cJSON_FOUND)
+ include_directories(${CJSON_INCLUDE_DIRS})
+ list(APPEND LIBS ${CJSON_LIBRARIES})
+ add_compile_definitions(CJSON_FOUND)
+endif()
find_package(Threads REQUIRED)
@@ -89,7 +97,7 @@ set(SRCS
)
add_subdirectory(aad)
-set(LIBS
+list(APPEND LIBS
winpr
freerdp
freerdp-client
diff --git a/client/SDL/man/CMakeLists.txt b/client/SDL/man/CMakeLists.txt
index d8677c416..1fb2adcf9 100644
--- a/client/SDL/man/CMakeLists.txt
+++ b/client/SDL/man/CMakeLists.txt
@@ -1,5 +1,6 @@
set(DEPS
sdl-freerdp-channels.1.xml
+ sdl-freerdp-config.1.xml
sdl-freerdp-examples.1.xml
sdl-freerdp-envvar.1.xml
)
@@ -8,4 +9,4 @@ set(MANPAGE_NAME ${PROJECT_NAME})
if (WITH_BINARY_VERSIONING)
set(MANPAGE_NAME ${PROJECT_NAME}${PROJECT_VERSION_MAJOR})
endif()
-generate_and_install_freerdp_man_from_xml(${PROJECT_NAME}.1 ${MANPAGE_NAME}.1 ${DEPS})
+generate_and_install_freerdp_man_from_xml(${PROJECT_NAME}.1 ${MANPAGE_NAME}.1 "${DEPS}")
diff --git a/client/SDL/man/sdl-freerdp-channels.1.xml b/client/SDL/man/sdl-freerdp-channels.1.xml
deleted file mode 100644
index e69de29bb..000000000
diff --git a/client/SDL/man/sdl-freerdp-config.1.xml.in b/client/SDL/man/sdl-freerdp-config.1.xml.in
new file mode 100644
index 000000000..3bace734f
--- /dev/null
+++ b/client/SDL/man/sdl-freerdp-config.1.xml.in
@@ -0,0 +1,81 @@
+
+ Configuration file
+
+
+
+ Format and Location:
+
+ The configuration file is stored per user.
+ The XDG_CONFIG_HOME environment variable can be used to override the base directory.
+ This defaults to ~/.config
+ The location relative to XDG_CONFIG_HOME is $XDG_CONFIG_HOME/@VENDOR@/@PRODUCT@/@PROJECT_NAME@.json
+ The configuration is stored in JSON format
+
+
+
+ Supported options:
+
+
+ SDL_KeyModMask
+
+
+
+ Defines the key combination required for SDL client shortcuts.
+ Default KMOD_RSHIFT
+ An array of SDL_Keymod strings as defined at https://wiki.libsdl.org/SDL2/SDL_Keymod
+
+
+
+
+
+ SDL_Fullscreen
+
+
+
+ Toggles client fullscreen state.
+ Default SDL_SCANCODE_RETURN.
+ A string as defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup
+
+
+
+
+
+ SDL_Resizeable
+
+
+
+ Toggles local window resizeable state.
+ Default SDL_SCANCODE_R.
+ A string as defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup
+
+
+
+
+
+ SDL_Grab
+
+
+
+ Toggles keyboard and mouse grab state.
+ Default SDL_SCANCODE_G.
+ A string as defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup
+
+
+
+
+
+ SDL_Disconnect
+
+
+
+ Disconnects from the RDP session.
+ Default SDL_SCANCODE_D.
+ A string as defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup
+
+
+
+
+
+
+
+
diff --git a/client/SDL/man/sdl-freerdp-envvar.1.xml b/client/SDL/man/sdl-freerdp-envvar.1.xml.in
similarity index 100%
rename from client/SDL/man/sdl-freerdp-envvar.1.xml
rename to client/SDL/man/sdl-freerdp-envvar.1.xml.in
diff --git a/client/SDL/man/sdl-freerdp-examples.1.xml b/client/SDL/man/sdl-freerdp-examples.1.xml.in
similarity index 100%
rename from client/SDL/man/sdl-freerdp-examples.1.xml
rename to client/SDL/man/sdl-freerdp-examples.1.xml.in
diff --git a/client/SDL/man/sdl-freerdp.1.xml.in b/client/SDL/man/sdl-freerdp.1.xml.in
index 20d23004e..c4b991845 100644
--- a/client/SDL/man/sdl-freerdp.1.xml.in
+++ b/client/SDL/man/sdl-freerdp.1.xml.in
@@ -4,6 +4,7 @@ PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+
]
@@ -51,6 +52,8 @@ PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
&channels;
+ &config;
+
&envvar;
&examples;
diff --git a/client/SDL/sdl_freerdp.cpp b/client/SDL/sdl_freerdp.cpp
index 7226d10b0..b6d5facdb 100644
--- a/client/SDL/sdl_freerdp.cpp
+++ b/client/SDL/sdl_freerdp.cpp
@@ -19,6 +19,7 @@
#include
#include
+#include
#include
@@ -1600,6 +1601,58 @@ static void SDLCALL winpr_LogOutputFunction(void* userdata, int category, SDL_Lo
category2str(category), message);
}
+static void print_config_file_help()
+{
+#if defined(CJSON_FOUND)
+ std::cout << "CONFIGURATION FILE" << std::endl;
+ std::cout << std::endl;
+ std::cout << " The SDL client supports some user defined configuration options." << std::endl;
+ std::cout << " Settings are stored in JSON format" << std::endl;
+ std::cout << " The location is a per user file. Location for current user is "
+ << sdl_get_pref_file() << std::endl;
+ std::cout
+ << " The XDG_CONFIG_HOME environment variable can be used to override the base directory."
+ << std::endl;
+ std::cout << std::endl;
+ std::cout << " The following configuration options are supported:" << std::endl;
+ std::cout << std::endl;
+ std::cout << " SDL_KeyModMask" << std::endl;
+ std::cout << " Defines the key combination required for SDL client shortcuts."
+ << std::endl;
+ std::cout << " Default KMOD_RSHIFT" << std::endl;
+ std::cout << " An array of SDL_Keymod strings as defined at "
+ "https://wiki.libsdl.org/SDL2/SDL_Keymod"
+ << std::endl;
+ std::cout << std::endl;
+ std::cout << " SDL_Fullscreen" << std::endl;
+ std::cout << " Toggles client fullscreen state." << std::endl;
+ std::cout << " Default SDL_SCANCODE_RETURN." << std::endl;
+ std::cout << " A string as "
+ "defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup"
+ << std::endl;
+ std::cout << std::endl;
+ std::cout << " SDL_Resizeable" << std::endl;
+ std::cout << " Toggles local window resizeable state." << std::endl;
+ std::cout << " Default SDL_SCANCODE_R." << std::endl;
+ std::cout << " A string as "
+ "defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup"
+ << std::endl;
+ std::cout << std::endl;
+ std::cout << " SDL_Grab" << std::endl;
+ std::cout << " Toggles keyboard and mouse grab state." << std::endl;
+ std::cout << " Default SDL_SCANCODE_G." << std::endl;
+ std::cout << " A string as "
+ "defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup"
+ << std::endl;
+ std::cout << std::endl;
+ std::cout << " SDL_Disconnect" << std::endl;
+ std::cout << " Disconnects from the RDP session." << std::endl;
+ std::cout << " Default SDL_SCANCODE_D." << std::endl;
+ std::cout << " A string as defined at https://wiki.libsdl.org/SDL2/SDLScancodeLookup"
+ << std::endl;
+#endif
+}
+
int main(int argc, char* argv[])
{
int rc = -1;
@@ -1624,6 +1677,7 @@ int main(int argc, char* argv[])
if (status)
{
rc = freerdp_client_settings_command_line_status_print(settings, status, argc, argv);
+ print_config_file_help();
if (freerdp_settings_get_bool(settings, FreeRDP_ListMonitors))
sdl_list_monitors(sdl);
return rc;
diff --git a/client/SDL/sdl_kbd.cpp b/client/SDL/sdl_kbd.cpp
index 03a608fc6..5bd6d6db3 100644
--- a/client/SDL/sdl_kbd.cpp
+++ b/client/SDL/sdl_kbd.cpp
@@ -22,6 +22,8 @@
#include "sdl_freerdp.hpp"
#include "sdl_utils.hpp"
+#include