Compare commits
7 Commits
ver/2.0-al
...
ver/2.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06dae56c66 | ||
|
|
31869a9094 | ||
|
|
799ef2da6b | ||
|
|
80941d968f | ||
|
|
041ce03f09 | ||
|
|
06c0ee790d | ||
|
|
e9535d5ee4 |
BIN
ZRCola/ZRCola.rc
BIN
ZRCola/ZRCola.rc
Binary file not shown.
@@ -106,7 +106,6 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\send.ico" />
|
||||
<None Include="res\zrcola.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -59,9 +59,6 @@
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\send.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="res\zrcola.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
@@ -25,9 +25,8 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
|
||||
EVT_UPDATE_UI_RANGE(wxZRColaFrame::wxID_SEND, wxZRColaFrame::wxID_SEND_DECOMPOSED, wxZRColaFrame::OnSendUpdate)
|
||||
EVT_UPDATE_UI_RANGE(wxZRColaFrame::wxID_SEND_COMPOSED, wxZRColaFrame::wxID_SEND_DECOMPOSED, wxZRColaFrame::OnSendUpdate)
|
||||
|
||||
EVT_MENU(wxZRColaFrame::wxID_SEND , wxZRColaFrame::OnSend )
|
||||
EVT_MENU(wxZRColaFrame::wxID_SEND_COMPOSED , wxZRColaFrame::OnSendComposed )
|
||||
EVT_MENU(wxZRColaFrame::wxID_SEND_DECOMPOSED , wxZRColaFrame::OnSendDecomposed )
|
||||
EVT_MENU(wxZRColaFrame::wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
|
||||
@@ -38,7 +37,6 @@ wxEND_EVENT_TABLE()
|
||||
|
||||
wxZRColaFrame::wxZRColaFrame() :
|
||||
m_hWndSource(NULL),
|
||||
m_hotkey(-1),
|
||||
wxZRColaFrameBase(NULL)
|
||||
{
|
||||
// Load main window icons.
|
||||
@@ -54,16 +52,17 @@ wxZRColaFrame::wxZRColaFrame() :
|
||||
m_panel->m_decomposed->SetFocus();
|
||||
|
||||
// Register global hotkey(s).
|
||||
if (!RegisterHotKey(wxZRColaHKID_INVOKE_COMPOSE, MOD_WIN, 'Z'))
|
||||
wxMessageBox(_("ZRCola keyboard shortcut Win+Z could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
|
||||
if (!RegisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE, MOD_WIN | MOD_SHIFT, 'Z'))
|
||||
wxMessageBox(_("ZRCola keyboard shortcut Win+Shift+Z could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
|
||||
if (!RegisterHotKey(wxZRColaHKID_INVOKE_COMPOSE, wxMOD_WIN, VK_F5))
|
||||
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
|
||||
if (!RegisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE, wxMOD_WIN, VK_F6))
|
||||
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
|
||||
|
||||
// Register frame specific hotkey(s).
|
||||
{
|
||||
wxAcceleratorEntry entries[2];
|
||||
entries[0].Set(wxACCEL_CTRL , WXK_RETURN, wxID_SEND);
|
||||
entries[1].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_SEND_ABORT);
|
||||
wxAcceleratorEntry entries[3];
|
||||
entries[0].Set(wxACCEL_NORMAL, WXK_F5 , wxID_SEND_COMPOSED);
|
||||
entries[1].Set(wxACCEL_NORMAL, WXK_F6 , wxID_SEND_DECOMPOSED);
|
||||
entries[2].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_SEND_ABORT);
|
||||
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
|
||||
}
|
||||
}
|
||||
@@ -83,16 +82,6 @@ void wxZRColaFrame::OnSendUpdate(wxUpdateUIEvent& event)
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnSend(wxCommandEvent& event)
|
||||
{
|
||||
switch (m_hotkey) {
|
||||
case wxZRColaHKID_INVOKE_COMPOSE : wxZRColaFrame::OnSendComposed (event); break;
|
||||
case wxZRColaHKID_INVOKE_DECOMPOSE: wxZRColaFrame::OnSendDecomposed(event); break;
|
||||
default : event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnSendComposed(wxCommandEvent& event)
|
||||
{
|
||||
if (m_hWndSource)
|
||||
@@ -118,7 +107,6 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
|
||||
::SetActiveWindow(m_hWndSource);
|
||||
::SetForegroundWindow(m_hWndSource);
|
||||
m_hWndSource = NULL;
|
||||
m_hotkey = -1;
|
||||
|
||||
// Select all input in composer to prepare for the overwrite next time.
|
||||
m_panel->m_decomposed->SelectAll();
|
||||
@@ -158,14 +146,6 @@ void wxZRColaFrame::DoSend(const wxString& str)
|
||||
// Enter (Return) key is sent as CR virtual key code.
|
||||
inp.ki.wVk = VK_RETURN;
|
||||
inp.ki.wScan = L'\r';
|
||||
} else if (L'a' <= c && c <= L'z') {
|
||||
// Small letters have the same virtual key code as their uppercase counterparts.
|
||||
inp.ki.wVk = (WORD)c + L'A' - L'a';
|
||||
inp.ki.wScan = c;
|
||||
} else if (L'A' <= c && c <= L'Z' || L'0' <= c && c <= L'0' || c == L' ') {
|
||||
// Letters and symbols with matching virtual key codes.
|
||||
inp.ki.wVk = c;
|
||||
inp.ki.wScan = c;
|
||||
} else {
|
||||
inp.ki.wVk = 0;
|
||||
inp.ki.wScan = c;
|
||||
@@ -178,7 +158,6 @@ void wxZRColaFrame::DoSend(const wxString& str)
|
||||
::Sleep(200);
|
||||
::SendInput(input.size(), input.data(), sizeof(INPUT));
|
||||
m_hWndSource = NULL;
|
||||
m_hotkey = -1;
|
||||
|
||||
// Select all input in composer and decomposed to prepare for the overwrite next time.
|
||||
m_panel->m_decomposed->SelectAll();
|
||||
@@ -206,7 +185,6 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
|
||||
}
|
||||
|
||||
m_hWndSource = hWndSource;
|
||||
m_hotkey = wParam;
|
||||
|
||||
//if (m_state == wxABS_FLOAT) {
|
||||
if (IsIconized()) {
|
||||
|
||||
@@ -43,8 +43,7 @@ class wxZRColaFrame : public wxZRColaFrameBase
|
||||
{
|
||||
protected:
|
||||
enum {
|
||||
wxID_SEND = wxID_HIGHEST,
|
||||
wxID_SEND_COMPOSED,
|
||||
wxID_SEND_COMPOSED = wxID_HIGHEST,
|
||||
wxID_SEND_DECOMPOSED,
|
||||
wxID_SEND_ABORT,
|
||||
};
|
||||
@@ -55,7 +54,6 @@ public:
|
||||
|
||||
protected:
|
||||
void OnSendUpdate(wxUpdateUIEvent& event);
|
||||
void OnSend(wxCommandEvent& event);
|
||||
void OnSendComposed(wxCommandEvent& event);
|
||||
void OnSendDecomposed(wxCommandEvent& event);
|
||||
void OnSendAbort(wxCommandEvent& event);
|
||||
@@ -71,5 +69,4 @@ protected:
|
||||
|
||||
protected:
|
||||
WXHWND m_hWndSource; ///< handle of the active window, when the ZRCola hotkey was pressed
|
||||
int m_hotkey; ///< hotkey ID that was pressed
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ wxZRColaKeyHandler::wxZRColaKeyHandler() : wxEvtHandler()
|
||||
|
||||
bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
|
||||
{
|
||||
if (event.GetEventType() == wxEVT_CHAR) {
|
||||
if (event.GetEventType() == wxEVT_KEY_DOWN) {
|
||||
// The character event occured.
|
||||
ZRCola::keyseq_db::indexKey::size_type start, end;
|
||||
bool found;
|
||||
@@ -61,7 +61,7 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
|
||||
// Parse key event and save it at the end of the key sequence.
|
||||
wxKeyEvent &e = (wxKeyEvent&)event;
|
||||
ZRCola::keyseq_db::keyseq::key_t key;
|
||||
key.key = wxToupper(e.m_uniChar);
|
||||
key.key = e.GetKeyCode(); //wxToupper(e.m_uniChar);
|
||||
key.modifiers =
|
||||
(e.ShiftDown() ? ZRCola::keyseq_db::keyseq::SHIFT : 0) |
|
||||
(e.ControlDown() ? ZRCola::keyseq_db::keyseq::CTRL : 0) |
|
||||
@@ -95,8 +95,8 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
|
||||
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), m_ks_db.idxKey[start].seq, std::min<unsigned __int16>(m_ks_db.idxKey[start].seq_len, m_seq.size())) == 0)
|
||||
{
|
||||
// The sequence is a partial match. Continue watching.
|
||||
event.StopPropagation();
|
||||
return true;
|
||||
//event.StopPropagation();
|
||||
//return true;
|
||||
} else {
|
||||
// The key sequence has no future chance to match. Start all over again.
|
||||
m_seq.clear();
|
||||
|
||||
@@ -274,11 +274,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
db.idxKey.reserve(count);
|
||||
db.data .reserve(count*4);
|
||||
|
||||
// Parse translations and build index and data.
|
||||
// Parse key sequences and build index and data.
|
||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
||||
// Read translation from the database.
|
||||
// Read key sequence from the database.
|
||||
if (src.GetKeySequence(rs, ks)) {
|
||||
// Add translation to index and data.
|
||||
// Add key sequence to index and data.
|
||||
unsigned __int32 idx = db.data.size();
|
||||
db.data.push_back(ks.chr);
|
||||
std::vector<ZRCola::DBSource::keyseq::keycode>::size_type n = ks.seq.size();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// Product version as a single DWORD
|
||||
// Note: Used for version comparison within C/C++ code.
|
||||
//
|
||||
#define ZRCOLA_VERSION 0x01ff0000
|
||||
#define ZRCOLA_VERSION 0x01ff0100
|
||||
|
||||
//
|
||||
// Product version by components
|
||||
@@ -33,26 +33,26 @@
|
||||
//
|
||||
#define ZRCOLA_VERSION_MAJ 1
|
||||
#define ZRCOLA_VERSION_MIN 255
|
||||
#define ZRCOLA_VERSION_REV 0
|
||||
#define ZRCOLA_VERSION_REV 1
|
||||
#define ZRCOLA_VERSION_BUILD 0
|
||||
|
||||
//
|
||||
// Human readable product version and build year for UI
|
||||
//
|
||||
#define ZRCOLA_VERSION_STR "2.0-alpha"
|
||||
#define ZRCOLA_VERSION_STR "2.0-alpha1"
|
||||
#define ZRCOLA_BUILD_YEAR_STR "2016"
|
||||
|
||||
//
|
||||
// Numerical version presentation for ProductVersion propery in
|
||||
// MSI packages (syntax: N.N[.N[.N]])
|
||||
//
|
||||
#define ZRCOLA_VERSION_INST "1.255"
|
||||
#define ZRCOLA_VERSION_INST "1.255.1"
|
||||
|
||||
//
|
||||
// The product code for ProductCode property in MSI packages
|
||||
// Replace with new on every version change, regardless how minor it is.
|
||||
//
|
||||
#define ZRCOLA_VERSION_GUID "{F0ECB49B-1EF8-487F-9BE3-B0CC3CADE8AE}"
|
||||
#define ZRCOLA_VERSION_GUID "{3A1032A5-E9D0-4603-94A7-C7D31AB4CB89}"
|
||||
|
||||
//
|
||||
// The product vendor and application name for configuration keeping.
|
||||
|
||||
Reference in New Issue
Block a user