[go: up one dir, main page]

Menu

[3129c8]: / configuration.h  Maximize  Restore  History

Download this file

125 lines (101 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#pragma once
#include "resource.h"
enum EMods {
LEFT_LSHIFT = 1 << 0,
LEFT_RSHIFT = 1 << 1,
LEFT_LCTRL = 1 << 2,
LEFT_RCTRL = 1 << 3,
LEFT_LALT = 1 << 4,
LEFT_RALT = 1 << 5,
LEFT_LWIN = 1 << 6,
LEFT_RWIN = 1 << 7,
LEFT_MENU = 1 << 8,
LEFT_MAX = 1 << 9
};
enum EHKType {
eHKTGroup = 0,
eHKTCycle,
eHKTCaps,
eHKTRecode,
eHKTEject,
eHKTRemap
};
union UHK {
unsigned long ulKey;
struct {
unsigned long ulHotKey : 25; // VK, SK, Mods
/* unsigned long _bCycleHK : 1;
unsigned long _bCapsHK : 1;
unsigned long _bRecodeHK : 1;
unsigned long _bEjectHK : 1;
unsigned long _bRemapHK : 1; */
};
struct {
unsigned long btVK : 8;
unsigned long btSK : 8;
unsigned long btMods : 9;
unsigned long btHKType : 5; // Cycle, Caps, Eject etc ...
unsigned long bExtKey : 1;
unsigned long bKeyDown : 1;
};
UHK(unsigned long key) : ulKey(key) {}
UHK(unsigned char VK,
unsigned char SK,
unsigned short Mods, bool Down, bool Ext)
: btVK(VK)
, btSK(SK)
, btMods(Mods)
, btHKType(eHKTGroup)
, bKeyDown(Down)
, bExtKey(Ext) {}
bool operator<(const UHK &ob) const {
return ulHotKey < ob.ulHotKey; }
};
struct KeyboardLayoutInfo {
int index;
std::basic_string<TCHAR> name;
std::basic_string<TCHAR> id;
BOOL inUse;
BOOL useLED;
BOOL showIcon;
HICON iconColor;
HICON iconGray;
KeyboardLayoutInfo(int _index = -1,
const TCHAR* _name = _T(""), const TCHAR* _id = _T(""))
: index(_index)
, name(_name)
, id(_id)
, inUse(TRUE)
, useLED(FALSE)
, showIcon(TRUE)
, iconColor(NULL)
, iconGray(NULL)
{}
};
extern DWORD g_dwModifiers;
extern bool g_bCustomizingOn;
extern UHK g_uhkLastHotkey;
extern DWORD g_dwKeysCount;
extern UHK g_uhkCurrentGroup;
extern int g_nHeightDelta;
extern int g_nWidthDelta;
extern int g_nLocalesDelta;
extern BYTE g_btStartOpacity;
extern BYTE g_btFinishOpacity;
extern BYTE g_btFadeOffSpeed;
extern int g_nGroupsDelta;
extern HICON g_hHKIcon;
const BYTE cbtFadeOffSpeedMin = 1;
const BYTE cbtFadeOffSpeedMax = 50;
const BYTE cbtFadeOffSpeedDef = 4;
const BYTE cbtOpacityMin = 0;
const BYTE cbtOpacityMax = 255;
const BYTE cbtStartOpacityDef = 255;
const BYTE cbtFinishOpacityDef = 0;
extern std::map<HKL, KeyboardLayoutInfo> g_keyboardInfo;
extern std::map<UHK, std::map<HKL, UHK>> g_hotkeyInfo;
int RunConfiguration(HWND hParentWnd);
bool LoadExternalIcon(HICON* phIcon, LPCTSTR lpszName);
void ExpandHotkeyName(std::basic_string<TCHAR>& name, UHK uhk);
DWORD VkToModBit(DWORD vkCode);
int AboutBoxDialog(HWND hParentWnd);