Skip to content

Commit a1d00c9

Browse files
author
Yatao Li
committed
support altgr aliasing.
1 parent 2c1625b commit a1d00c9

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ FVimUIWildMenu v:false " external wildmenu -- work in progress
150150
" Keyboard mapping options
151151
FVimKeyDisableShiftSpace v:true " disable unsupported sequence <S-Space>
152152
FVimKeyAutoIme v:true " Automatic input method engagement in Insert mode
153+
FVimKeyAltGr v:true " Recognize AltGr. Side effect is that <C-A-Key> is then impossible
153154
154155
" Detach from a remote session without killing the server
155156
" If this command is executed on a standalone instance,

fvim.vim

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ command! -complete=expression -nargs=1 FVimFontBoldWeight call rpcnotify(g:fvim_
2828
command! -complete=expression -nargs=1 FVimFontNoBuiltinSymbols call rpcnotify(g:fvim_channel, 'font.nonerd', <args>)
2929
command! -complete=expression -nargs=1 FVimKeyDisableShiftSpace call rpcnotify(g:fvim_channel, 'key.disableShiftSpace', <args>)
3030
command! -complete=expression -nargs=1 FVimKeyAutoIme call rpcnotify(g:fvim_channel, 'key.autoIme', <args>)
31+
command! -complete=expression -nargs=1 FVimKeyAltGr call rpcnotify(g:fvim_channel, 'key.altGr', <args>)
3132

3233
" let! _ = nvim.``command!`` -complete=expression FVimUIMultiGrid 1 call rpcnotify(g:fvim_channel, 'ui.multigrid', <args>)
3334
command! -complete=expression -nargs=1 FVimUIPopupMenu call rpcnotify(g:fvim_channel, 'ui.popupmenu', <args>)

input.fs

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ let (|HasFlag|_|) (flag: KeyModifiers) (x: KeyModifiers) =
7272
let (|NoFlag|_|) (flag: KeyModifiers) (x: KeyModifiers) =
7373
if x.HasFlag flag then None else Some()
7474
let (|DoesntBlockTextInput|_|) (x: KeyModifiers) =
75-
if x.HasFlag (KeyModifiers.Alt) || x.HasFlag (KeyModifiers.Control) || x.HasFlag (KeyModifiers.Meta) then None else Some()
75+
if states.key_altGr && x.HasFlag (KeyModifiers.Alt) && x.HasFlag (KeyModifiers.Control) then Some()
76+
elif x.HasFlag (KeyModifiers.Alt) || x.HasFlag (KeyModifiers.Control) || x.HasFlag (KeyModifiers.Meta) then None
77+
else Some()
7678
let (|NvimSupportedMouseButton|_|) (mb: MouseButton) =
7779
match mb with
7880
| MouseButton.Left | MouseButton.Right | MouseButton.Middle -> Some mb

model.fs

+1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ let Start (serveropts, norc, remote) =
364364
rpc.register.bool "cursor.smoothmove"
365365
rpc.register.bool "key.disableShiftSpace"
366366
rpc.register.bool "key.autoIme"
367+
rpc.register.bool "key.altGr"
367368
//rpc.register.bool "ui.multigrid"
368369
rpc.register.bool "ui.popupmenu"
369370
//rpc.register.bool "ui.tabline"

states.fs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ let mutable channel_id = 1
1212
// keyboard mapping
1313
let mutable key_disableShiftSpace = false
1414
let mutable key_autoIme = false
15+
let mutable key_altGr = false
1516

1617
// clipboard
1718
let mutable clipboard_lines: string[] = [||]

0 commit comments

Comments
 (0)