Commit Graph

35 Commits

Author SHA1 Message Date
Lars Toenning
685f455eab refactor: Rename BlackInput to swift::input 2024-11-11 14:49:00 +01:00
Lars Toenning
bcc4bdd31e Add SPDX identifiers for REUSE compliance
Co-authored-by: Mat Sutcliffe <oktal3700@gmail.com>
2023-10-03 09:29:49 +02:00
Lars Toenning
970b7c3650 clang-format src 2023-04-18 16:07:19 +02:00
Mat Sutcliffe
33209fa1eb Use std::as_const (C++17 feature) 2021-07-13 17:56:31 +01:00
Mat Sutcliffe
22301c1a1f Use structured bindings (C++17 feature) 2021-07-13 17:56:29 +01:00
Mat Sutcliffe
b80114213d Issue #77 Move mixin classes to separate files
By separating them from unrelated code, their dependents
can use them without depending on unrelated code, which
in turn helps to reduce cyclic dependencies.
2020-08-29 14:16:17 +01:00
Klaus Basan
7d51bedc3e [AFV] misc style issues:
* object name
* simple style fixes
* some renamings
* comments
2020-06-12 18:42:53 +01:00
Klaus Basan
ef4640e66f [Hotkey] Style 2020-01-07 19:57:21 +00:00
Mat Sutcliffe
57ff07592a [AFV] CInputManager stores icon indexes instead of QPixmap instances
The GUI converts icon indexes to QPixmap indexes when needed.
This fixes the context unittest that was broken by audio context changes.
2019-10-11 19:00:52 +01:00
Klaus Basan
50412aa0d1 Preparation for 2 COM keys and increase/decrease volume hotkeys
Ref T672, Ref T642
2019-09-16 20:29:46 +01:00
Klaus Basan
6ff118b3c0 Ref T645, minor style changes 2019-05-13 11:21:04 +02:00
Klaus Basan
375d26de32 The magic hotkey handling alorithm developed and tested in joined effort via SLACK
* no redundant action calls
* do not call release action if the action is still active by another combination

ref T585
2019-04-11 22:12:20 +01:00
Roland Rossgotterer
563a69e3f5 Remember and ignore hotkey combination before capturing
When capturing a new hotkey combination, we want to get only the delta of the keys and buttons being pressed during the capturing. 

ref T585
2019-04-11 22:12:20 +01:00
Roland Rossgotterer
c51a1b8c7b Don't trigger an action during combination capturing
ref T595
2019-04-11 22:12:19 +01:00
Roland Rossgotterer
59c69e379a Change InputManager trigger behavior to subset triggering
Previously, InputManager triggered an action only for exact matching. If 'CTRL' was configured, the action would be released as soon as 'CTRL + R' was pressed.
The behavior is changed now that the action stays active as long as its configured combination is keeping pressed (ignoring any extra keys/buttons).

ref T595
2019-04-11 22:12:19 +01:00
Mat Sutcliffe
e9a4c49d68 Ref T547 Update license masthead in all source code files. 2019-02-22 20:36:43 +00:00
Roland Rossgotterer
e5c435f281 Add function to retrieve all available joystick buttons 2019-02-22 20:36:23 +00:00
Roland Winklmeier
1addcf631a Refactor the remote hotkeys to avoid round trips
The previous implementation was hard to follow and maintain. Instead of
doing intentional rounds trips, we use now a two way approach. GUI is
automatically forwarding remote actions by calling "callHotkeyActionRemotely"
through DBus. Core on the other hand, emits a signal "remoteHotkeyAction"
that is processed in a different function in GUI.
On both sides, actions from the same local machine are filtered.

ref T402
2018-11-04 17:42:42 +01:00
Roland Winklmeier
f6ea2a9107 Move CInputManager from singleton to CApplication member
The main reason why CInputManager was singleton is the easy access across
the code. That had the negative side effect that time of destruction was
at a very late stage of the shutdown and could not be controlled by us.
My moving it to CApplication, the access is equally easy (using sApp) and
allows to be cleaned up properly during graceful shutdown.

ref T391
2018-11-04 17:42:42 +01:00
Roland Winklmeier
832082c5bc Delay creating input devices to when required
Every first call to CInputManager::instance() was automatically creating
the low level input devices. This was not always desired and therefore
creation is now explicit via function.
Unit tests do not need the devices created. In contrast, Windows unit tests
failed since Windows didn't like the Jenkins service childs to allocate
DInput devices.

T391
2018-10-07 16:17:28 +02:00
Roland Winklmeier
c42900f959 Release input devices when application is shutdown
If they are released with the deallocation of CInputManager, we might
run into global deallocation hell.
Also on Windows release all DirectX devices before COM library is closed.

ref T391
2018-10-07 16:17:26 +02:00
Roland Winklmeier
b6180d33af Convert private slots to private functions 2018-08-31 20:08:17 +02:00
Roland Winklmeier
2856dad280 Fix hotkey settings not loaded during app start
CInputManager is listening for hotkey settings changes, but it never loaded
the current state during construction and kept an empty setting.

ref T318
2018-08-31 20:08:16 +02:00
Klaus Basan
48738c87ab Keyboard and input manager cleanup/style 2018-08-22 12:32:06 +02:00
Mathew Sutcliffe
3ea9e33e6b refs #937 Resolved clazy warnings: pass-by-value/reference. 2017-04-19 19:31:42 +01:00
Mathew Sutcliffe
fce1513dae refs #937 Resolved clazy warnings: unnecessary detaching of containers. 2017-04-19 19:31:38 +01:00
Roland Winklmeier
0c8f2f596e Let CInputManager select only action hotkeys applicable to local machine
So far, CInputManager did not properly ignore action hotkey settings
which did not belong to the local machine.

refs #881
2017-04-17 23:59:12 +01:00
Klaus Basan
a34be02e07 refs #617, CActionItem supports icon
* standard paths for applications
* support for Qt::DecorationRole
* QMap<QString, QPixmap> m_availableActions
* Constructor for icon only
* only leafs support actions
2017-02-24 15:20:54 +00:00
Klaus Basan
eeaed099f0 Formatting, typos 2017-02-24 15:20:39 +00:00
Roland Winklmeier
7f9c99ca7a Decouple system keyboard/joystick events from connected actions
The Mac OS/X event loop complained that system event processing took
too much time and disabled event taps. This commit speeds up system
event handling by connecting CInputManager with a queued connection.
This calls all (potentially expensive) hotkey actions asynchronously.
2016-08-26 21:05:21 +01:00
Mathew Sutcliffe
9bef6854ca Caches: rename "get" to "getThreadLocal" and rename "getCopy" to get. 2016-06-08 18:21:01 +02:00
Roland Winklmeier
933271b828 Fix BlackCore header includes
* Include only what is used
* Use forward declaration when possible
* Sorted includes

refs #598
2016-05-13 17:06:00 +02:00
Roland Winklmeier
bd251b5de6 Fix license headers 2016-02-16 20:01:21 +01:00
Roland Winklmeier
7953d550ea Fix linux clang errors and warnings
refs #596
2016-02-15 18:35:34 +01:00
Michał Garapich
1b06e15b61 refs #510 Remove underscores from all the source file names 2015-11-22 12:53:09 +01:00