mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
15cb327bbd
* opt: rewrite keyboardstate.cc --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
27 lines
739 B
C++
27 lines
739 B
C++
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
#ifndef __KEYBOARDSTATE_HH_INCLUDED__
|
|
#define __KEYBOARDSTATE_HH_INCLUDED__
|
|
|
|
/// Since Qt doesn't provide a way to test for keyboard modifiers state
|
|
/// when the app isn't in focus, we have to implement this separately for
|
|
/// each platform.
|
|
class KeyboardState
|
|
{
|
|
public:
|
|
|
|
enum Modifier {
|
|
Alt = 1,
|
|
Ctrl = 2,
|
|
Shift = 4,
|
|
Win = 8, // Ironically, Linux only, since it's no use under Windows
|
|
};
|
|
|
|
/// Returns true if all Modifiers present within the given mask are pressed
|
|
/// right now.
|
|
bool static checkModifiersPressed( int mask );
|
|
};
|
|
|
|
#endif
|