From 093030ebd80a5de497f765e35e96bec11dd9de8f Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 6 Apr 2024 14:40:37 +0200 Subject: [PATCH] Added possibility to run device in single thread --- README.md | 5 +++++ src/devices/keyboard-joypad/KeyboardJoypad.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea1dbfd..9ee0ac3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,12 @@ The device can be configured using the following parameters. They are all option - ``window_height``: height of the window in pixels (default: 720) - ``buttons_per_row``: number of buttons per row in the "Buttons" widget (default: 4) - ``allow_window_closing``: when specified or set to true, the window can be closed by pressing the "X" button in the title bar. Note: when using this as device, the parent might keep running anyway (default: false) +- ``no_gui_thread``: when specified or set to true, the GUI will run in the same thread as the device. The GUI will be updated when calling ``updateService`` or when getting the values of axis/buttons (default: false, true on macOS) - ``axes``: definition of the list of axes. The allowed values are "ws", "ad", "up_down" and "left_right". It is possible to select the default sign for an axis prepending a "+" or a "-" to the axis name. For example, "+ws" will set the "ws" axis with the default sign, while "-ws" will set the "ws" axis with the inverted sign. It is also possible to repeat some axis, and use "none" or "" to have dummy axes with always zero value. The order matters. (default: ("ad", "ws", "left_right", "up_down")) - ``wasd_label``: label for the "WASD" widget (default: "WASD") - ``arrows_label``: label for the "Arrows" widget (default: "Arrows") - ``buttons``: definition of the list of buttons. The allowed values are all the letters from A to Z, all the numbers from 0 to 9, "SPACE", "ENTER", "ESCAPE", "BACKSPACE", "DELETE", "LEFT", "RIGHT", "UP", "DOWN". It is possible to repeat some button. It is possible to specify an alias after a ":". For example "A:Some Text" will create a button with the label "Some Text" that can be activated by pressing "A". It is possible to use "none" or "" to indicate a dummy button always zero. It is possible to spcify multiple keys using the "-" delimiter. For example, "A-B:Some Text" creates a button named "Some Text" that can be activated pressing either A or B. It is possible to repeat buttons. The order matters. (default: ()) + + +## Maintainers +* Stefano Dafarra ([@S-Dafarra](https://github.com/S-Dafarra)) \ No newline at end of file diff --git a/src/devices/keyboard-joypad/KeyboardJoypad.cpp b/src/devices/keyboard-joypad/KeyboardJoypad.cpp index 55fe3cd..3cc6334 100644 --- a/src/devices/keyboard-joypad/KeyboardJoypad.cpp +++ b/src/devices/keyboard-joypad/KeyboardJoypad.cpp @@ -257,7 +257,7 @@ struct Settings { //If macOs, the GUI thread must be the main thread. Hence use no GUI thread #ifdef __APPLE__ single_threaded = true; - yCWarning(KEYBOARDJOYPAD) << "In MacOs the GUI thread should be the main thread. Hence, we are using true as default for \"no_gui_thread\""; + yCWarning(KEYBOARDJOYPAD) << "In macOS the GUI thread should be the main thread. Hence, we are using true as default for \"no_gui_thread\""; #endif //__APPLE__