mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-14 22:03:27 +01:00
remove unneeded function
This commit is contained in:
parent
f202c47735
commit
77c69d7e23
@ -1240,21 +1240,27 @@ void __fastcall TConfigForm::HotkeyEdtKeyUp(TObject *Sender, WORD &Key, TShiftSt
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
WORD TConfigForm::GetKeyCode(System::UnicodeString key)
|
||||
WORD TConfigForm::GetKeyCode(System::UnicodeString text)
|
||||
{
|
||||
if (key == L"PrtScn") {
|
||||
if (text == L"PrtScn") {
|
||||
return VK_SNAPSHOT;
|
||||
}
|
||||
|
||||
if (key == L"Pause_") {
|
||||
if (text == L"Pause_") {
|
||||
return VK_PAUSE;
|
||||
}
|
||||
|
||||
if (key == L"R " + KeyToText(VK_CONTROL)) {
|
||||
if (text == L"R " + KeyToText(VK_CONTROL)) {
|
||||
return VK_RCONTROL;
|
||||
}
|
||||
|
||||
return TextToKey(key);
|
||||
for (WORD i = 0; i < 256; i++) {
|
||||
if (KeyNames[i] == text) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
System::UnicodeString TConfigForm::GetKeyText(WORD key)
|
||||
@ -1278,21 +1284,8 @@ System::UnicodeString TConfigForm::GetKeyText(WORD key)
|
||||
return KeyToText(key);
|
||||
}
|
||||
|
||||
WORD TConfigForm::TextToKey(System::UnicodeString Text)
|
||||
{
|
||||
for (WORD i = 0; i < 256; i++) {
|
||||
if (KeyNames[i] == Text) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
System::UnicodeString TConfigForm::KeyToText(WORD key)
|
||||
{
|
||||
WCHAR keyName[256] = {};
|
||||
|
||||
UINT scanCode = MapVirtualKeyW(key, MAPVK_VK_TO_VSC);
|
||||
|
||||
switch (key) {
|
||||
@ -1314,6 +1307,7 @@ System::UnicodeString TConfigForm::KeyToText(WORD key)
|
||||
}
|
||||
}
|
||||
|
||||
WCHAR keyName[256] = {};
|
||||
GetKeyNameTextW(scanCode << 16, keyName, sizeof(keyName) / sizeof(WCHAR));
|
||||
|
||||
KeyNames[(BYTE)key] = keyName;
|
||||
|
@ -120,8 +120,7 @@ private: // Benutzer-Deklarationen
|
||||
bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue);
|
||||
void ApplyTranslation(TIniFile *ini);
|
||||
System::UnicodeString GetKeyText(WORD key);
|
||||
WORD GetKeyCode(System::UnicodeString key);
|
||||
WORD TextToKey(System::UnicodeString Text);
|
||||
WORD GetKeyCode(System::UnicodeString text);
|
||||
System::UnicodeString KeyToText(WORD key);
|
||||
void DisableGameUX();
|
||||
void AddDllOverride();
|
||||
|
Loading…
x
Reference in New Issue
Block a user