Commit Graph

102 Commits

Author SHA1 Message Date
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
Martin Pulec
111261847e Key control: print which options are guarded 2019-10-30 10:23:10 +01:00
Martin Pulec
288ff631fe Key control: simplified option guarding guarded 2019-10-30 08:52:20 +01:00
Martin Pulec
95d1e3d36b Key control: command to enter key
+ simplified the structure of keyboard_control::run() a bit
2019-10-30 08:33:37 +01:00
Martin Pulec
d0ddfaec03 Key control: restructuralize events a bit 2019-10-29 21:55:40 +01:00
Martin Pulec
c72b12491e Key control: use CV [Windows] 2019-10-29 21:55:40 +01:00
Martin Pulec
8864f88c61 Key control: improvements
- guard the recently added commands ('C', 'q', 's')
- display output related commands to cout instead with logger to prevent
  dismissing important messages (suspended output/verbose=0) which would
  confuse user (that may not know that the output is suspended)
- missing log_level restore in read_command() on EOF
2019-10-11 10:21:30 +02:00