Browse Source

added option to not handle multple hot key presses to move selection

scott brogden 5 years ago
parent
commit
968285ff5a
7 changed files with 42 additions and 12 deletions
  1. 13 1
      AdvGeneral.cpp
  2. 9 6
      MainFrm.cpp
  3. 13 0
      Options.cpp
  4. 4 0
      Options.h
  5. 1 1
      OptionsGeneral.cpp
  6. 1 3
      OptionsKeyBoard.cpp
  7. 1 1
      QPasteWnd.cpp

+ 13 - 1
AdvGeneral.cpp

@@ -128,6 +128,7 @@ END_MESSAGE_MAP()
 #define SETTING_ADD_CF_HDROP_ON_DRAG 77
 #define SETTING_COPY_SAVE_DELAY 78
 #define SETTING_EDITOR_FONT_SIZE 79
+#define SETTING_MOVE_SELECTION_ON_OPEN_HOTKEY 80
 
 BOOL CAdvGeneral::OnInitDialog()
 {
@@ -191,7 +192,7 @@ BOOL CAdvGeneral::OnInitDialog()
 	AddTrueFalse(pGroupTest, _T("Hide Ditto on Hot Key if Ditto is Visible"), CGetSetOptions::GetHideDittoOnHotKeyIfAlreadyShown(), SETTING_HIDE_ON_HOTKEY_IF_VISIBLE);
 	pGroupTest->AddSubItem( new CMFCPropertyGridProperty(_T("Maximum Clip Size in Bytes (0 for no limit)"), g_Opt.m_lMaxClipSizeInBytes, _T(""), SETTING_MAX_CLIP_SIZE));
 	
-	
+	AddTrueFalse(pGroupTest, _T("Move Selection On Open Hot Key"), CGetSetOptions::GetMoveSelectionOnOpenHotkey(), SETTING_MOVE_SELECTION_ON_OPEN_HOTKEY);
 	
 	pGroupTest->AddSubItem( new CMFCPropertyGridProperty(_T("Multi-Paste clip separator ([LF] = line feed)"), g_Opt.GetMultiPasteSeparator(false), _T(""), SETTING_CLIP_SEPARATOR));
 
@@ -797,6 +798,17 @@ void CAdvGeneral::OnBnClickedOk()
 					CGetSetOptions::SetEditorDefaultFontSize(pNewValue->lVal);
 				}
 				break;
+			case SETTING_MOVE_SELECTION_ON_OPEN_HOTKEY:
+				if (pNewValue->lVal != pOrigValue->lVal)
+				{
+					BOOL val = false;
+					if (wcscmp(pNewValue->bstrVal, L"True") == 0)
+					{
+						val = true;
+					}
+					CGetSetOptions::SetMoveSelectionOnOpenHotkey(val);
+				}
+				break;
 			}
 		}
 	}

+ 9 - 6
MainFrm.cpp

@@ -573,11 +573,14 @@ void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 
 void CMainFrame::StartKeyModifyerTimer()
 {
-	m_keyModifiersTimerCount = 0;
-	m_bMovedSelectionMoveKeyState = false;
-	m_startKeyStateTime = GetTickCount();
-	m_keyStateModifiers = CAccels::GetKeyStateModifiers();
-	SetTimer(KEY_STATE_MODIFIERS, 50, NULL);
+	if (g_Opt.m_moveSelectionOnOpenHotkey)
+	{
+		m_keyModifiersTimerCount = 0;
+		m_bMovedSelectionMoveKeyState = false;
+		m_startKeyStateTime = GetTickCount();
+		m_keyStateModifiers = CAccels::GetKeyStateModifiers();
+		SetTimer(KEY_STATE_MODIFIERS, 50, NULL);
+	}
 }
 
 void CMainFrame::PasteOrShowGroup(int dbId, BOOL updateClipTime, BOOL activeTarget, BOOL sendPaste, bool pastedFromGroup)
@@ -1099,7 +1102,7 @@ CString WndName(HWND hParent)
 
 void CMainFrame::OnFirstHelp()
 {
-    CHyperLink::GotoURL(_T("https://sourceforge.net/p/ditto-cp/wiki/"), SW_SHOW);
+    CHyperLink::GotoURL(_T("https://github.com/sabrogden/Ditto/wiki"), SW_SHOW);
 }
 
 void CMainFrame::ShowErrorMessage(CString csTitle, CString csMessage)

+ 13 - 0
Options.cpp

@@ -76,6 +76,7 @@ BOOL CGetSetOptions::m_cleanRTFBeforeDrawing = TRUE;
 int CGetSetOptions::m_doubleKeyStrokeTimeout = 350;
 int CGetSetOptions::m_firstTenHotKeysStart = 1;
 int CGetSetOptions::m_firstTenHotKeysFontSize = 5;
+BOOL CGetSetOptions::m_moveSelectionOnOpenHotkey = TRUE;
 
 CGetSetOptions::CGetSetOptions()
 {
@@ -198,6 +199,7 @@ void CGetSetOptions::LoadSettings()
 	m_doubleKeyStrokeTimeout = GetDoubleKeyStrokeTimeout();
 	m_firstTenHotKeysStart = GetFirstTenHotKeysStart();
 	m_firstTenHotKeysFontSize = GetFirstTenHotKeysFontSize();
+	m_moveSelectionOnOpenHotkey = GetMoveSelectionOnOpenHotkey();
 
 	GetExtraNetworkPassword(true);
 
@@ -2870,4 +2872,15 @@ int CGetSetOptions::GetEditorDefaultFontSize()
 void CGetSetOptions::SetEditorDefaultFontSize(int val)
 {
 	SetProfileLong("EditorDefaultFontSize", val);
+}
+
+BOOL CGetSetOptions::GetMoveSelectionOnOpenHotkey()
+{
+	return GetProfileLong("MoveSelectionOnOpenHotkey", TRUE);
+}
+
+void CGetSetOptions::SetMoveSelectionOnOpenHotkey(BOOL val)
+{
+	m_moveSelectionOnOpenHotkey = val;
+	SetProfileLong("MoveSelectionOnOpenHotkey", val);
 }

+ 4 - 0
Options.h

@@ -643,6 +643,10 @@ public:
 	static int GetEditorDefaultFontSize();
 	static void SetEditorDefaultFontSize(int val);
 
+	static BOOL m_moveSelectionOnOpenHotkey;
+	static BOOL GetMoveSelectionOnOpenHotkey();
+	static void SetMoveSelectionOnOpenHotkey(BOOL val);
+
 
 };
 

+ 1 - 1
OptionsGeneral.cpp

@@ -89,7 +89,7 @@ BOOL COptionsGeneral::OnInitDialog()
 {
 	CPropertyPage::OnInitDialog();
 
-	CString url = _T("https://sourceforge.net/p/ditto-cp/wiki/EnvironmentVariables/");
+	CString url = _T("https://github.com/sabrogden/Ditto/wiki/Environment-Variables");
 
 	m_brush.CreateSolidBrush(RGB(251, 251, 251));
 	

+ 1 - 3
OptionsKeyBoard.cpp

@@ -69,9 +69,7 @@ BOOL COptionsKeyBoard::OnInitDialog()
 {
 	CPropertyPage::OnInitDialog();
 
-	CString csHelpPath = CGetSetOptions::GetPath(PATH_HELP);
-	csHelpPath += "DittoCustomKeys.htm";
-	m_CustomeKeysHelp.SetURL(csHelpPath);
+	m_CustomeKeysHelp.SetURL(_T("https://github.com/sabrogden/Ditto/wiki/Custom-Key-Strokes"));
 
 	m_pParent = (COptionsSheet *)GetParent();
 

+ 1 - 1
QPasteWnd.cpp

@@ -2485,7 +2485,7 @@ void CQPasteWnd::OnMenuImport()
 
 void CQPasteWnd::OnMenuHelp()
 {
-	CHyperLink::GotoURL(_T("https://sourceforge.net/p/ditto-cp/wiki/"), SW_SHOW);
+	CHyperLink::GotoURL(_T("https://github.com/sabrogden/Ditto/wiki"), SW_SHOW);
 }
 
 void CQPasteWnd::OnMenuQuickoptionsFont()