Skip to content

Commit

Permalink
support altgr aliasing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Mar 18, 2022
1 parent 2c1625b commit a1d00c9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ FVimUIWildMenu v:false " external wildmenu -- work in progress
" Keyboard mapping options
FVimKeyDisableShiftSpace v:true " disable unsupported sequence <S-Space>
FVimKeyAutoIme v:true " Automatic input method engagement in Insert mode
FVimKeyAltGr v:true " Recognize AltGr. Side effect is that <C-A-Key> is then impossible
" Detach from a remote session without killing the server
" If this command is executed on a standalone instance,
Expand Down
1 change: 1 addition & 0 deletions fvim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ command! -complete=expression -nargs=1 FVimFontBoldWeight call rpcnotify(g:fvim_
command! -complete=expression -nargs=1 FVimFontNoBuiltinSymbols call rpcnotify(g:fvim_channel, 'font.nonerd', <args>)
command! -complete=expression -nargs=1 FVimKeyDisableShiftSpace call rpcnotify(g:fvim_channel, 'key.disableShiftSpace', <args>)
command! -complete=expression -nargs=1 FVimKeyAutoIme call rpcnotify(g:fvim_channel, 'key.autoIme', <args>)
command! -complete=expression -nargs=1 FVimKeyAltGr call rpcnotify(g:fvim_channel, 'key.altGr', <args>)

" let! _ = nvim.``command!`` -complete=expression FVimUIMultiGrid 1 call rpcnotify(g:fvim_channel, 'ui.multigrid', <args>)
command! -complete=expression -nargs=1 FVimUIPopupMenu call rpcnotify(g:fvim_channel, 'ui.popupmenu', <args>)
Expand Down
4 changes: 3 additions & 1 deletion input.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ let (|HasFlag|_|) (flag: KeyModifiers) (x: KeyModifiers) =
let (|NoFlag|_|) (flag: KeyModifiers) (x: KeyModifiers) =
if x.HasFlag flag then None else Some()
let (|DoesntBlockTextInput|_|) (x: KeyModifiers) =
if x.HasFlag (KeyModifiers.Alt) || x.HasFlag (KeyModifiers.Control) || x.HasFlag (KeyModifiers.Meta) then None else Some()
if states.key_altGr && x.HasFlag (KeyModifiers.Alt) && x.HasFlag (KeyModifiers.Control) then Some()
elif x.HasFlag (KeyModifiers.Alt) || x.HasFlag (KeyModifiers.Control) || x.HasFlag (KeyModifiers.Meta) then None
else Some()
let (|NvimSupportedMouseButton|_|) (mb: MouseButton) =
match mb with
| MouseButton.Left | MouseButton.Right | MouseButton.Middle -> Some mb
Expand Down
1 change: 1 addition & 0 deletions model.fs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ let Start (serveropts, norc, remote) =
rpc.register.bool "cursor.smoothmove"
rpc.register.bool "key.disableShiftSpace"
rpc.register.bool "key.autoIme"
rpc.register.bool "key.altGr"
//rpc.register.bool "ui.multigrid"
rpc.register.bool "ui.popupmenu"
//rpc.register.bool "ui.tabline"
Expand Down
1 change: 1 addition & 0 deletions states.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let mutable channel_id = 1
// keyboard mapping
let mutable key_disableShiftSpace = false
let mutable key_autoIme = false
let mutable key_altGr = false

// clipboard
let mutable clipboard_lines: string[] = [||]
Expand Down

0 comments on commit a1d00c9

Please sign in to comment.