Allow Ctrl+c to copy and update readme
This commit is contained in:
parent
0be5f4207c
commit
60e0819f68
|
@ -10,7 +10,7 @@ vibreoffice currently supports:
|
||||||
- Movement keys: `hjkl`, `w`, `W`, `b`, `B`, `e`, `$`, `^`, `{}`, `()`, `C-d`, `C-u`
|
- Movement keys: `hjkl`, `w`, `W`, `b`, `B`, `e`, `$`, `^`, `{}`, `()`, `C-d`, `C-u`
|
||||||
- Search movement: `f`, `F`, `t`, `T`
|
- Search movement: `f`, `F`, `t`, `T`
|
||||||
- Number modifiers: e.g. `5w`, `4fa`
|
- Number modifiers: e.g. `5w`, `4fa`
|
||||||
- Deletion: `x`, `d`, `c`, `dd`, `cc`
|
- Deletion: `x`, `d`, `c`, `C`, `D`, `dd`, `cc`
|
||||||
- Plus movement and number modifiers: e.g. `dw`, `c$`, `5dd`, `c3j`
|
- Plus movement and number modifiers: e.g. `dw`, `c$`, `5dd`, `c3j`
|
||||||
- More to come!
|
- More to come!
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,10 @@ function KeyHandler_KeyPressed(oEvent) as boolean
|
||||||
|
|
||||||
' Show terminal-like cursor
|
' Show terminal-like cursor
|
||||||
oTextCursor = getTextCursor()
|
oTextCursor = getTextCursor()
|
||||||
If MODE = "NORMAL" Then
|
If oEvent.Modifiers = 2 Or oEvent.Modifiers = 8 And oEvent.KeyChar = "c" Then
|
||||||
|
' Allow Ctrl+c for Copy, so don't change cursor
|
||||||
|
' Pass
|
||||||
|
ElseIf MODE = "NORMAL" Then
|
||||||
cursorReset(oTextCursor)
|
cursorReset(oTextCursor)
|
||||||
ElseIf MODE = "INSERT" Then
|
ElseIf MODE = "INSERT" Then
|
||||||
oTextCursor.gotoRange(oTextCursor.getStart(), False)
|
oTextCursor.gotoRange(oTextCursor.getStart(), False)
|
||||||
|
@ -328,8 +331,10 @@ End Function
|
||||||
|
|
||||||
|
|
||||||
Function ProcessModeKey(oEvent)
|
Function ProcessModeKey(oEvent)
|
||||||
|
dim bIsModified
|
||||||
|
bIsModified = oEvent.Modifiers > 1 ' If Ctrl or Alt is held down. (Shift=1)
|
||||||
' Don't change modes in these circumstances
|
' Don't change modes in these circumstances
|
||||||
If MODE <> "NORMAL" Or getSpecial <> "" Or getMovementModifier() <> "" Then
|
If MODE <> "NORMAL" Or bIsModified Or getSpecial <> "" Or getMovementModifier() <> "" Then
|
||||||
ProcessModeKey = False
|
ProcessModeKey = False
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
@ -388,10 +393,17 @@ Function ProcessNormalKey(oEvent)
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
' --------------------
|
' --------------------
|
||||||
' 2. Check Delete Key
|
' 2. Check Delete Key
|
||||||
' --------------------
|
' --------------------
|
||||||
|
|
||||||
|
' There are no delete keys with modifier keys, so exit early
|
||||||
|
If oEvent.Modifiers > 1 Then
|
||||||
|
ProcessNormalKey = False
|
||||||
|
Exit Function
|
||||||
|
End If
|
||||||
|
|
||||||
' Only 'x' or Special (dd, cc) can be done more than once
|
' Only 'x' or Special (dd, cc) can be done more than once
|
||||||
If oEvent.KeyChar <> "x" and getSpecial() = "" Then
|
If oEvent.KeyChar <> "x" and getSpecial() = "" Then
|
||||||
iIterations = 1
|
iIterations = 1
|
||||||
|
|
Loading…
Reference in New Issue