-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
neovide ignores 'alt+' codes on Windows #2449
Comments
That's very tricky to implement, due to the fact that someone might want to map But you can use this instead: If you type something often, you could also possibly use abbreviations: |
I thought it possible to do that with a plugin, something like function! s:AltMap(start)
let nr = s:keys[a:start]
let i = 0
let extra = ""
while 1
let next = getchar(1)
if next is# 0
sleep 1m
let i += 1
elseif next is# 0x80
" Note: getcharstr(1) for some reason only gets first byte which is
" 0x80. Thus may just as well use getchar() and not allocate
" a useless string.
let s = getcharstr()
if has_key(s:keys, s)
let i = 0
let nr = nr * 10 + s:keys[s]
else
break
endif
else
break
endif
endwhile
return nr2char(nr) . extra
endfunction
function! MakeMaps()
unlockvar s:keys
let s:keys = {}
let v = 0
let alts = ["Insert",
\ "kEnd", "Down", "kPageDown",
\ "Left", "kOrigin", "Right",
\ "kHome", "Up", "kPageUp"]
while v < 10
for key in ["".v, alts[v]]
let mkeyhrstr = "<M-" . key . ">"
let mkeystr = eval('"\' . mkeyhrstr . '"')
let s:keys[mkeystr] = v
execute 'map <expr>' mkeyhrstr '<SID>AltMap('.string(mkeystr).')'
execute 'map! <expr>' mkeyhrstr '<SID>AltMap('.string(mkeystr).')'
endfor
let v += 1
endwhile
lockvar! s:keys
endfunction
call MakeMaps() After checking that I still think it is possible, but unfortunately, this specific code tends to fail due to In any case, you can do this with a plugin, only if you are OK with character appearing either after timeout or after typing something else instead of after Alt release. Also plugin could not care whether or not you released Alt button while typing Alt+number sequence: button release events are not forwarded to neovim. |
I am wondering though: if it is a common convention, should not there be either some option used on window creation (i.e. implemented by Windows itself) or, at least, winit option to not forward |
I have the same problem on OSX |
Can also confirm this same issue on osx. My hacky workaround is to remap the option maps I'm used to to something else (eg. ctrl+shift+f16) in karabiner for neovide gui |
@svermeulen there is a better workaound. Just focus any text editor window and type "alt+shift+. <M-S-.>
nnoremap ˘ <C-w>5+
"alt+shift+, <M-S-,>
nnoremap ¯ <C-w>5-
"alt+. <M-.>
nnoremap ≥ <C-w>5>
"alt+, <M-,>
nnoremap ≤ <C-w>5< |
Describe the bug
Neovide running on Windows ignores 'alt+' codes to paste unicode characters that are not present in standard keyboards.
To Reproduce
<alt>
+<whathever number combination>
(i tried alt+96 (`
) and alt+126 (~
))<alt>
Expected behavior
The character should be inserted into the buffer after releasing
Desktop (please complete the following information):
logs
I can provide logs when running the steps to reproduce, if necessary
Additional context
https://www.alt-codes.net/
The text was updated successfully, but these errors were encountered: