Non-working locale-specific key sequences issue fixed
This commit is contained in:
parent
1867235007
commit
994ec6461e
@ -1,8 +1,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: ZRCola\n"
|
||||
"POT-Creation-Date: 2016-05-06 13:38+0200\n"
|
||||
"PO-Revision-Date: 2016-05-06 13:39+0200\n"
|
||||
"POT-Creation-Date: 2016-05-06 14:24+0200\n"
|
||||
"PO-Revision-Date: 2016-05-06 14:24+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
||||
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
||||
"Language: sl_SI\n"
|
||||
@ -17,191 +17,147 @@ msgstr ""
|
||||
"X-Poedit-KeywordsList: _\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: zrcolaapp.cpp:146
|
||||
#: zrcolaapp.cpp:155
|
||||
msgid "Esc"
|
||||
msgstr "Esc"
|
||||
|
||||
#: zrcolaapp.cpp:148
|
||||
#: zrcolaapp.cpp:157
|
||||
msgid "F1"
|
||||
msgstr "F1"
|
||||
|
||||
#: zrcolaapp.cpp:149
|
||||
#: zrcolaapp.cpp:158
|
||||
msgid "F2"
|
||||
msgstr "F2"
|
||||
|
||||
#: zrcolaapp.cpp:150
|
||||
#: zrcolaapp.cpp:159
|
||||
msgid "F3"
|
||||
msgstr "F3"
|
||||
|
||||
#: zrcolaapp.cpp:151
|
||||
#: zrcolaapp.cpp:160
|
||||
msgid "F4"
|
||||
msgstr "F4"
|
||||
|
||||
#: zrcolaapp.cpp:152
|
||||
#: zrcolaapp.cpp:161
|
||||
msgid "F5"
|
||||
msgstr "F5"
|
||||
|
||||
#: zrcolaapp.cpp:153
|
||||
#: zrcolaapp.cpp:162
|
||||
msgid "F6"
|
||||
msgstr "F6"
|
||||
|
||||
#: zrcolaapp.cpp:154
|
||||
#: zrcolaapp.cpp:163
|
||||
msgid "F7"
|
||||
msgstr "F7"
|
||||
|
||||
#: zrcolaapp.cpp:155
|
||||
#: zrcolaapp.cpp:164
|
||||
msgid "F8"
|
||||
msgstr "F8"
|
||||
|
||||
#: zrcolaapp.cpp:156
|
||||
#: zrcolaapp.cpp:165
|
||||
msgid "F9"
|
||||
msgstr "F9"
|
||||
|
||||
#: zrcolaapp.cpp:157
|
||||
#: zrcolaapp.cpp:166
|
||||
msgid "F10"
|
||||
msgstr "F10"
|
||||
|
||||
#: zrcolaapp.cpp:158
|
||||
#: zrcolaapp.cpp:167
|
||||
msgid "F11"
|
||||
msgstr "F11"
|
||||
|
||||
#: zrcolaapp.cpp:159
|
||||
#: zrcolaapp.cpp:168
|
||||
msgid "F12"
|
||||
msgstr "F12"
|
||||
|
||||
#: zrcolaapp.cpp:161
|
||||
#: zrcolaapp.cpp:170
|
||||
msgid "Print Screen"
|
||||
msgstr "Print Screen"
|
||||
|
||||
#: zrcolaapp.cpp:162
|
||||
#: zrcolaapp.cpp:171
|
||||
msgid "Scroll Lock"
|
||||
msgstr "Scroll Lock"
|
||||
|
||||
#: zrcolaapp.cpp:163
|
||||
#: zrcolaapp.cpp:172
|
||||
msgid "Pause"
|
||||
msgstr "Pause"
|
||||
|
||||
#: zrcolaapp.cpp:165
|
||||
msgid "`"
|
||||
msgstr "`"
|
||||
|
||||
#: zrcolaapp.cpp:166
|
||||
msgid "-"
|
||||
msgstr "-"
|
||||
|
||||
#: zrcolaapp.cpp:167
|
||||
msgid "+"
|
||||
msgstr "+"
|
||||
|
||||
#: zrcolaapp.cpp:168
|
||||
#: zrcolaapp.cpp:174
|
||||
msgid "Backspace"
|
||||
msgstr "Backspace"
|
||||
|
||||
#: zrcolaapp.cpp:169
|
||||
#: zrcolaapp.cpp:175
|
||||
msgid "Tab"
|
||||
msgstr "Tab"
|
||||
|
||||
#: zrcolaapp.cpp:170
|
||||
#: zrcolaapp.cpp:176
|
||||
msgid "Caps Lock"
|
||||
msgstr "Caps Lock"
|
||||
|
||||
#: zrcolaapp.cpp:171
|
||||
msgid "["
|
||||
msgstr "["
|
||||
|
||||
#: zrcolaapp.cpp:172
|
||||
msgid "]"
|
||||
msgstr "]"
|
||||
|
||||
#: zrcolaapp.cpp:173
|
||||
#: zrcolaapp.cpp:177
|
||||
msgid "Return"
|
||||
msgstr "Return"
|
||||
|
||||
#: zrcolaapp.cpp:174
|
||||
msgid ":"
|
||||
msgstr ":"
|
||||
|
||||
#: zrcolaapp.cpp:175
|
||||
msgid "'"
|
||||
msgstr "'"
|
||||
|
||||
#: zrcolaapp.cpp:176
|
||||
msgid "\\"
|
||||
msgstr "\\"
|
||||
|
||||
#: zrcolaapp.cpp:177
|
||||
msgid ","
|
||||
msgstr ","
|
||||
|
||||
#: zrcolaapp.cpp:178
|
||||
msgid "."
|
||||
msgstr "."
|
||||
|
||||
#: zrcolaapp.cpp:179
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
#: zrcolaapp.cpp:180
|
||||
msgid "Space"
|
||||
msgstr "preslednica"
|
||||
|
||||
#: zrcolaapp.cpp:182
|
||||
#: zrcolaapp.cpp:180
|
||||
msgid "Shift"
|
||||
msgstr "Shift"
|
||||
|
||||
#: zrcolaapp.cpp:183
|
||||
#: zrcolaapp.cpp:181
|
||||
msgid "Alt"
|
||||
msgstr "Alt"
|
||||
|
||||
#: zrcolaapp.cpp:184
|
||||
#: zrcolaapp.cpp:182
|
||||
msgid "Ctrl"
|
||||
msgstr "Ctrl"
|
||||
|
||||
#: zrcolaapp.cpp:185
|
||||
#: zrcolaapp.cpp:183
|
||||
msgid "Menu"
|
||||
msgstr "Menu"
|
||||
|
||||
#: zrcolaapp.cpp:187
|
||||
#: zrcolaapp.cpp:185
|
||||
msgid "Insert"
|
||||
msgstr "Insert"
|
||||
|
||||
#: zrcolaapp.cpp:188
|
||||
#: zrcolaapp.cpp:186
|
||||
msgid "Delete"
|
||||
msgstr "Delete"
|
||||
|
||||
#: zrcolaapp.cpp:189
|
||||
#: zrcolaapp.cpp:187
|
||||
msgid "Page Up"
|
||||
msgstr "Page Up"
|
||||
|
||||
#: zrcolaapp.cpp:190
|
||||
#: zrcolaapp.cpp:188
|
||||
msgid "Page Down"
|
||||
msgstr "Page Down"
|
||||
|
||||
#: zrcolaapp.cpp:191
|
||||
#: zrcolaapp.cpp:189
|
||||
msgid "Home"
|
||||
msgstr "Home"
|
||||
|
||||
#: zrcolaapp.cpp:192
|
||||
#: zrcolaapp.cpp:190
|
||||
msgid "End"
|
||||
msgstr "End"
|
||||
|
||||
#: zrcolaapp.cpp:194
|
||||
#: zrcolaapp.cpp:192
|
||||
msgid "Left"
|
||||
msgstr "Left"
|
||||
|
||||
#: zrcolaapp.cpp:195
|
||||
#: zrcolaapp.cpp:193
|
||||
msgid "Up"
|
||||
msgstr "Up"
|
||||
|
||||
#: zrcolaapp.cpp:196
|
||||
#: zrcolaapp.cpp:194
|
||||
msgid "Right"
|
||||
msgstr "Right"
|
||||
|
||||
#: zrcolaapp.cpp:197
|
||||
#: zrcolaapp.cpp:195
|
||||
msgid "Down"
|
||||
msgstr "Down"
|
||||
|
||||
#: zrcolaapp.cpp:199
|
||||
#: zrcolaapp.cpp:197
|
||||
msgid "Num Lock"
|
||||
msgstr "Num Lock"
|
||||
|
||||
@ -441,6 +397,39 @@ msgstr "1250"
|
||||
msgid "Input system for linguistic use"
|
||||
msgstr "Vnašalni sistem za jezikoslovno rabo"
|
||||
|
||||
#~ msgid "`"
|
||||
#~ msgstr "`"
|
||||
|
||||
#~ msgid "-"
|
||||
#~ msgstr "-"
|
||||
|
||||
#~ msgid "+"
|
||||
#~ msgstr "+"
|
||||
|
||||
#~ msgid "["
|
||||
#~ msgstr "["
|
||||
|
||||
#~ msgid "]"
|
||||
#~ msgstr "]"
|
||||
|
||||
#~ msgid ":"
|
||||
#~ msgstr ":"
|
||||
|
||||
#~ msgid "'"
|
||||
#~ msgstr "'"
|
||||
|
||||
#~ msgid "\\"
|
||||
#~ msgstr "\\"
|
||||
|
||||
#~ msgid ","
|
||||
#~ msgstr ","
|
||||
|
||||
#~ msgid "."
|
||||
#~ msgstr "."
|
||||
|
||||
#~ msgid "/"
|
||||
#~ msgstr "/"
|
||||
|
||||
#~ msgid "INS"
|
||||
#~ msgstr "INS"
|
||||
|
||||
|
@ -130,19 +130,28 @@ bool ZRColaApp::OnInit()
|
||||
}
|
||||
|
||||
|
||||
void ZRColaApp::GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len, _Out_ std::wstring& str)
|
||||
bool ZRColaApp::GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len, _Out_ wxString& str)
|
||||
{
|
||||
assert(seq || !seq_len);
|
||||
|
||||
str.clear();
|
||||
str.Clear();
|
||||
for (size_t i = 0; i < seq_len; i++) {
|
||||
if (i) str += L", ";
|
||||
if (seq[i].modifiers & ZRCola::keyseq_db::keyseq::CTRL ) str += L"Ctrl+";
|
||||
if (seq[i].modifiers & ZRCola::keyseq_db::keyseq::ALT ) str += L"Alt+";
|
||||
if (seq[i].modifiers & ZRCola::keyseq_db::keyseq::SHIFT) str += L"Shift+";
|
||||
wchar_t k = seq[i].key;
|
||||
#if defined(__WXMSW__)
|
||||
// Translate from U.S. Keyboard to scan code.
|
||||
static const HKL s_hkl = ::LoadKeyboardLayout(_T("00000409"), 0);
|
||||
k = ::MapVirtualKeyEx(k, MAPVK_VK_TO_VSC, s_hkl);
|
||||
|
||||
// Translate from scan code to local keyboard.
|
||||
k = ::MapVirtualKey(k, MAPVK_VSC_TO_VK);
|
||||
#endif
|
||||
switch (k) {
|
||||
// TODO: Localize keys according to active keyboard.
|
||||
case 0 : return false;
|
||||
|
||||
case WXK_ESCAPE : str += _("Esc" ); break;
|
||||
|
||||
case WXK_F1 : str += _("F1" ); break;
|
||||
@ -162,21 +171,10 @@ void ZRColaApp::GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db
|
||||
case WXK_SCROLL : str += _("Scroll Lock" ); break;
|
||||
case WXK_PAUSE : str += _("Pause" ); break;
|
||||
|
||||
case VK_OEM_3 : str += _("`" ); break;
|
||||
case VK_OEM_MINUS : str += _("-" ); break;
|
||||
case VK_OEM_PLUS : str += _("+" ); break;
|
||||
case WXK_BACK : str += _("Backspace" ); break;
|
||||
case WXK_TAB : str += _("Tab" ); break;
|
||||
case WXK_CAPITAL : str += _("Caps Lock" ); break;
|
||||
case VK_OEM_4 : str += _("[" ); break;
|
||||
case VK_OEM_6 : str += _("]" ); break;
|
||||
case WXK_RETURN : str += _("Return" ); break;
|
||||
case VK_OEM_1 : str += _(":" ); break;
|
||||
case VK_OEM_7 : str += _("'" ); break;
|
||||
case VK_OEM_5 : str += _("\\" ); break;
|
||||
case VK_OEM_COMMA : str += _("," ); break;
|
||||
case VK_OEM_PERIOD: str += _("." ); break;
|
||||
case VK_OEM_2 : str += _("/" ); break;
|
||||
case WXK_SPACE : str += _("Space" ); break;
|
||||
|
||||
case WXK_SHIFT : str += _("Shift" ); break;
|
||||
@ -198,7 +196,13 @@ void ZRColaApp::GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db
|
||||
|
||||
case WXK_NUMLOCK : str += _("Num Lock" ); break;
|
||||
|
||||
default : str += k;
|
||||
default:
|
||||
#if defined(__WXMSW__)
|
||||
k = ::MapVirtualKey(k, MAPVK_VK_TO_CHAR);
|
||||
#endif
|
||||
str += k;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -65,7 +65,11 @@ public:
|
||||
/// \param[in] seq_len Number of elements in \p seq
|
||||
/// \param[out] str Text representation of a \p seq key sequence
|
||||
///
|
||||
static void GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len, _Out_ std::wstring& str);
|
||||
/// \returns
|
||||
/// - \c true if conversion succeeded
|
||||
/// - \c false otherwise
|
||||
///
|
||||
static bool GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len, _Out_ wxString& str);
|
||||
|
||||
///
|
||||
/// Get text representation of a given key sequence
|
||||
@ -75,11 +79,10 @@ public:
|
||||
///
|
||||
/// \returns Text representation of a \p seq key sequence
|
||||
///
|
||||
static inline std::wstring GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len)
|
||||
static inline wxString GetKeySequenceAsText(_In_count_(seq_len) const ZRCola::keyseq_db::keyseq::key_t *seq, _In_ size_t seq_len)
|
||||
{
|
||||
std::wstring str;
|
||||
GetKeySequenceAsText(seq, seq_len, str);
|
||||
return str;
|
||||
wxString str;
|
||||
return GetKeySequenceAsText(seq, seq_len, str) ? str : wxEmptyString;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -102,7 +102,9 @@ wxString wxZRColaCharGrid::GetToolTipText(int idx)
|
||||
|
||||
if (found) {
|
||||
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
|
||||
return wxString::Format(wxT("U+%04X (%s)"), (int)m_chars[idx], ZRColaApp::GetKeySequenceAsText(seq.seq, seq.seq_len).c_str());
|
||||
wxString ks_str;
|
||||
if (ZRColaApp::GetKeySequenceAsText(seq.seq, seq.seq_len, ks_str))
|
||||
return wxString::Format(wxT("U+%04X (%s)"), (int)m_chars[idx], ks_str.c_str());
|
||||
}
|
||||
|
||||
return wxString::Format(wxT("U+%04X"), (int)m_chars[idx]);
|
||||
|
@ -72,6 +72,14 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
|
||||
// Parse key event and save it at the end of the key sequence.
|
||||
ZRCola::keyseq_db::keyseq::key_t key;
|
||||
key.key = e.GetRawKeyCode();
|
||||
#if defined(__WXMSW__)
|
||||
// Translate from local keyboard to scan code.
|
||||
key.key = ::MapVirtualKey(key.key, MAPVK_VK_TO_VSC);
|
||||
|
||||
// Translate from scan code to U.S. Keyboard.
|
||||
static const HKL s_hkl = ::LoadKeyboardLayout(_T("00000409"), 0);
|
||||
key.key = ::MapVirtualKeyEx(key.key, MAPVK_VSC_TO_VK, s_hkl);
|
||||
#endif
|
||||
key.modifiers =
|
||||
(e.ShiftDown() ? ZRCola::keyseq_db::keyseq::SHIFT : 0) |
|
||||
(e.ControlDown() ? ZRCola::keyseq_db::keyseq::CTRL : 0) |
|
||||
|
Loading…
x
Reference in New Issue
Block a user