summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Scriver/src/input.cpp')
-rw-r--r--plugins/Scriver/src/input.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index 61acf8f9be..620db9d6b1 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -112,6 +112,39 @@ void InputAreaContextMenu(HWND hwnd, WPARAM, LPARAM lParam, MCONTACT hContact)
DestroyMenu(hMenu);
}
+bool CScriverWindow::CheckSend()
+{
+ BOOL isShift = GetKeyState(VK_SHIFT) & 0x8000;
+ BOOL isCtrl = GetKeyState(VK_CONTROL) & 0x8000;
+ BOOL isAlt = GetKeyState(VK_MENU) & 0x8000;
+
+ if (!isShift && !isCtrl && g_dat.sendMode == SEND_ON_ENTER) {
+ PostMessage(m_hwnd, WM_COMMAND, IDOK, 0);
+ return true;
+ }
+ if (!isShift && isCtrl && g_dat.sendMode == SEND_ON_CTRL_ENTER) {
+ PostMessage(m_hwnd, WM_COMMAND, IDOK, 0);
+ return true;
+ }
+ if (isShift && !isCtrl && g_dat.sendMode == SEND_ON_SHIFT_ENTER) {
+ PostMessage(m_hwnd, WM_COMMAND, IDOK, 0);
+ return true;
+ }
+
+ if (g_dat.sendMode == SEND_ON_DBL_ENTER) {
+ if (m_iLastEnterTime + 1000 < GetTickCount())
+ m_iLastEnterTime = GetTickCount();
+ else {
+ m_log.SendMsg(WM_KEYDOWN, VK_BACK, 0);
+ m_log.SendMsg(WM_KEYUP, VK_BACK, 0);
+ PostMessage(m_hwnd, WM_COMMAND, IDOK, 0);
+ return true;
+ }
+ }
+
+ return false;
+}
+
int CScriverWindow::InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL isShift = GetKeyState(VK_SHIFT) & 0x8000;