Commit Graph

108 Commits

Author SHA1 Message Date
Martin Pulec
e1b28f83d6 keyboard_control: option to force in gdb
doesn't seem to be necessary at least since gdb 9.2 in Ubuntu 20.04
2023-06-15 16:14:08 +02:00
Martin Pulec
602095e38a fixed some further snprintf warns
fixes warnings with Xcode 14.3 as in previous commit

+ allocate +1 in Log_output buffer - snprintf(MULL, 0...) returns number
  of bytes without terminating '\0'. std::string storage isn't guaranteed
  to be NULL-terminated (std::string("").at(0) throws an exception). The
  buffer is somewhere preallocated 256 which prevents problem but it's
  better not to rely upon it.
+ comment out some unused function in LDGM that also triggered the
  warning but looked a bit suspicious so it was not clear how to fix
2023-04-12 12:52:07 +02:00
Martin Pulec
d9aa8dcb1f fixed incomp. keyboard_control::impl decl & def 2022-11-08 16:49:37 +01:00
Martin Pulec
59de3f69e8 key_control: hide implementation
termios.h would interfere with Vulkan headers otherwise (Arch Linux)

+ added missing includes in pano_gl
2022-11-03 13:16:59 +01:00
Martin Pulec
b1f0e004f4 fixed new Coverity bugs
Fixed some of (easy) newly detected Coverity bugs. Those are mostly
innocent ones (performance) and not new (detected because of new release
of Coverity).
2022-08-22 09:57:16 +02:00
Martin Pulec
65557d112d get rid of rang.hpp dependency through color_out.h
Removed indirect dependency on rang.hpp through color_out.h. Now only
remaining dependencies on rang.hpp are direct.

+ fixed escape sequence for foreground magenta
2022-08-17 17:24:34 +02:00
Martin Pulec
95b851eecb replaced \e with \033
'\e' is not standard C, see:
https://stackoverflow.com/questions/63255838/how-can-i-fix-warning-c4129-e-unrecognized-character-escape-sequence/63255920#63255920
2022-08-10 17:01:31 +02:00
Martin Piatka
e0245aeda5 host,keyboard_control: Move gdb detection to a function 2022-08-09 11:48:58 +02:00
Martin Piatka
ca0421787a keyboard_control: use getter&setter for repeat skipping 2022-08-05 13:44:35 +02:00
Martin Pulec
53caa93976 restore old tio in crash_signal_handler
In case of crash, atexit callbacks are not called, thus terminal state
is not restored (if modified by keyboard control).
2022-08-04 14:07:46 +02:00
Martin Piatka
65d7cf69b8 logging: Split timestamp and repeat functionality into its own class
This will eventually allow better integration with other formatting
functions like color_out, color_printf
2022-08-03 10:41:14 +02:00
Martin Pulec
59379869d8 key control: disable if running in GDB
Terminal control (especitally turning echo off) is probably not a best
idea if running from inside GDB.
2022-06-29 09:33:53 +02:00
Martin Pulec
69145ce011 fixed Coverity CID 383373 2022-02-21 15:32:03 +01:00
Martin Pulec
35bfc4cced Fixed warnings for -Og 2022-01-17 15:10:34 +01:00
Martin Pulec
1b3b27eb7c Updated copyright dates for modified files 2021-11-08 15:43:14 +01:00
Martin Pulec
2e13a04dff Key control: print version
May be used for quick check if not running an obsolete UG during
runtime.
2021-11-01 09:20:44 +01:00
Martin Pulec
dfe80f3348 keyboard_control.cpp: refactor a bit the audio query stuff
(related to previous commmit)
2021-10-27 14:35:07 +02:00
Martin Pulec
2ec8eec912 Audio: display muted status even if not sending
Originally mute for both sender and receiver were dispatched by the
sender, which doesn't need to be present, however.
2021-10-27 13:31:17 +02:00
Martin Pulec
50d759fc9a Audio: interactive info mute improvements
- show actual playback volume as 0 (-inf) if muted receiver
- display explicitly receiver mute status
- "Received audio volume" -> "Playback volume" - this has more clear
  semantics and is consistent with message written when '*'/'/'/'m' is
  pressed.
2021-10-04 11:55:01 +02:00
Martin Pulec
2865ea8a4c keycontrol_send_key(): improved doxy documentation 2021-08-02 15:13:58 +02:00
Martin Pulec
b97dc5ffda Fixed some Windows warnings 2021-05-13 09:08:26 +02:00
Martin Pulec
b888e09800 Key control: shortcut to control repeating of msgs 2020-11-13 14:50:29 +01:00
Martin Pulec
48895b0783 ADD_TO_PARAM: salt is no longer needed
UNIQUE_NAME is used instead of the salt
2020-06-09 14:02:37 +02:00
Martin Pulec
ea3a9deba5 Keycontrol: store tio state first
Previously the state was saved too late, eg. when display was libcaca
(over SDL) the saved state has been already modified.
2020-04-23 14:56:21 +02:00
Martin Pulec
07309035a5 Control: warn about unknown command 2020-04-21 18:27:57 +02:00
Martin Pulec
363729fbcd Keycontrol: fixes
- fixed few warnings (UTF-8 code 0 UB, read fail)
- keycodes can be up to 64-bit (some places used int)
2020-04-21 18:27:57 +02:00
Martin Pulec
1a8523f12c Keycontrol: use more user-friendly key names 2020-02-04 11:24:04 +01:00
Martin Pulec
63606f3f9d Missing Ctrl-{up,dn} string representation 2020-02-04 11:23:15 +01:00
Martin Pulec
9dba8b7bed Keycontrol: fixed parsing of "map" message
Strtoll must be used instead of strtol because long is 32-bit in Win64
API.
2020-01-29 17:09:29 +01:00
Martin Pulec
75e3b22b79 Keycontrol: deinitialize module in stop 2019-11-29 17:20:04 +01:00
Martin Pulec
5f349ea55a Support for PgUp/PgDown 2019-11-27 15:35:15 +01:00
Martin Pulec
18a5252eb8 Keycontrol: print error when re-registring the same key 2019-11-27 07:43:44 +01:00
Martin Pulec
184b51997e Keycontrol: again initailize relatively soon
Module that register their keybindings use NOSTORE option.
2019-11-27 07:43:43 +01:00
Martin Pulec
09f6bafc58 Coverity fixes 2019-11-22 13:54:51 +01:00
Martin Pulec
ee76cba241 Keycontrol: fixes
- register module only if started
- name thread in correct function
2019-11-20 22:39:18 +01:00
Martin Pulec
64a2d4bc02 Main: exit modules before common_cleanup
In MSW, pipe is emulated over network socket (used by state_uv).
Common_cleanup, however, calls WSACleanup().
2019-11-19 19:45:20 +01:00
Martin Pulec
fa51f6e33c Fixed incorrectly fixed Coverity bugs 2019-11-12 22:34:18 +01:00
Martin Pulec
4c71573a89 Fixed first series of Coverity bugs 2019-11-09 17:20:37 +01:00
Martin Pulec
3795e5a6c6 Keycontrol: updates
- support for alt
- is_utf8: fixed infinite loop when for negative number
- do not use tolower() in K_CTRL - is not constexpr
- get_keycode_name - safety check
2019-11-04 11:47:59 +01:00
Martin Pulec
dcc550d677 Keycontrol: shortened some names
This allows easier formatting - name is now at most 7 characters long.

+ assert to check if parameters to keycontrol_register_key() do not
  contain '#'-symbols.
2019-11-04 10:42:02 +01:00
Martin Pulec
e52874998c Keycontrol: function to obtain key name 2019-11-04 10:35:17 +01:00
Martin Pulec
7693b3e1e5 Keycontrol: change audio delay keys
Interferred with key bindings from GL. In addition, this mapping seems
to be more intuitive.
2019-11-04 10:18:34 +01:00
Martin Pulec
ff0fb6a310 Use fct attr used to preserve key_control syms
This prevents them from being removed by linker with the modular build.
2019-11-01 11:33:08 +01:00
Martin Pulec
02bfed5b77 Keyboard control: changes
- changed preset 'q' to 'S' not to interfere with import
- check guarding also for custom keys (although currently it
  cannot be enabled)
2019-10-31 14:35:07 +01:00
Martin Pulec
be388bf7cc Simplify the previous commit
Moved the registration logic directly to keyboard control.
2019-10-31 09:56:03 +01:00
Martin Pulec
306cc9563a GL: register fullscreen key 2019-10-31 09:56:03 +01:00
Martin Pulec
35757c31f3 Moved common key sending from displays 2019-10-31 08:04:36 +01:00
Martin Pulec
db8556b97f Key control: fixed locking 2019-10-30 13:40:10 +01:00
Martin Pulec
68f53099df Key control: print representation of Ctrl keys 2019-10-30 10:30:34 +01:00
Martin Pulec
adbc9c058b Key control: use BOLD() macro for readibility 2019-10-30 10:23:16 +01:00