From 7cf594590075a832a4a2e4bb1200bd5c6284b1fb Mon Sep 17 00:00:00 2001 From: Sean Yeh Date: Thu, 30 Jul 2015 17:24:17 -0500 Subject: [PATCH] #12: Allow Ctrl-a to select all --- src/vibreoffice.vbs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vibreoffice.vbs b/src/vibreoffice.vbs index 269bed3..1d6e8c5 100644 --- a/src/vibreoffice.vbs +++ b/src/vibreoffice.vbs @@ -271,10 +271,11 @@ function KeyHandler_KeyPressed(oEvent) as boolean Exit Function End If - dim bConsumeInput, bIsMultiplier, bIsModified, bIsSpecial + dim bConsumeInput, bIsMultiplier, bIsModified, bIsControl, bIsSpecial bConsumeInput = True ' Block all inputs by default bIsMultiplier = False ' reset multiplier by default bIsModified = oEvent.Modifiers > 1 ' If Ctrl or Alt is held down. (Shift=1) + bIsControl = (oEvent.Modifiers = 2) or (oEvent.Modifiers = 8) bIsSpecial = getSpecial() <> "" @@ -308,8 +309,12 @@ function KeyHandler_KeyPressed(oEvent) as boolean ' Pass ' If is modified but doesn't match a normal command, allow input - ' (Useful for built-in shortcuts like Ctrl+s, Ctrl+w) + ' (Useful for built-in shortcuts like Ctrl+a, Ctrl+s, Ctrl+w) ElseIf bIsModified Then + ' Ctrl+a (select all) sets mode to VISUAL + If bIsControl And oEvent.KeyChar = "a" Then + gotoMode("VISUAL") + End If bConsumeInput = False ' Movement modifier here?