vim icon indicating copy to clipboard operation
vim copied to clipboard

W32 GUI: set active keyboard layout for gvim

Open ant0sha opened this issue 3 years ago • 3 comments

New function "setkblayout" usable from tests is introduced, to control keyboard layout of running gvim. Usage example (expected to insert string "d€@ö" into current buffer, it requires my last PR #10814 - uses Alt+Ctrl as AltGr thus need to activate German keyboard layout as first):

call test_gui_event("setkblayout", #{kblayout: "DE", keycode: -99})

func SendMyKeys(keylist) let l:k = "" let l:t = "" for key in a:keylist "echomsg "k[i]=".key if l:k == "" let l:k = key "echomsg "l:k=".l:k else let l:t = key "echomsg "l:t=".l:k endif if l:t != "" if l:t == "du" "echomsg "k=".l:k.", t=".l:t call test_gui_event("sendevent", #{event: "keydown", keycode: l:k}) call test_gui_event("sendevent", #{event: "keyup", keycode: l:k}) endif if l:t == "d" call test_gui_event("sendevent", #{event: "keydown", keycode: l:k}) endif if l:t == "u" call test_gui_event("sendevent", #{event: "keyup", keycode: l:k}) endif let l:t="" let l:k="" endif endfor endfunc

" call SendMyKeys([73,"du"]) " <d ctrl, Lalt, e->€ q->@ ö ctrl_up, lalt_up> call SendMyKeys([68,"du", 17,"d",18,"d", 69,"du",81,"du",192,"du", 17,"u",18,"u"])

ant0sha avatar Jul 30 '22 11:07 ant0sha

more testcases are coming...

ant0sha avatar Jul 30 '22 12:07 ant0sha

Codecov Report

Merging #10815 (025448f) into master (ddab3ce) will increase coverage by 0.00%. The diff coverage is 52.17%.

@@           Coverage Diff           @@
##           master   #10815   +/-   ##
=======================================
  Coverage   81.78%   81.78%           
=======================================
  Files         158      158           
  Lines      185927   186009   +82     
  Branches    42026    42046   +20     
=======================================
+ Hits       152052   152135   +83     
+ Misses      21403    21398    -5     
- Partials    12472    12476    +4     
Flag Coverage Δ
huge-clang-none 82.65% <ø> (+<0.01%) :arrow_up:
linux 82.65% <ø> (+<0.01%) :arrow_up:
mingw-x64-HUGE 0.00% <0.00%> (ø)
mingw-x64-HUGE-gui 78.27% <52.17%> (+0.02%) :arrow_up:
windows 77.04% <52.17%> (+0.02%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/gui_w32.c 38.03% <47.61%> (+1.14%) :arrow_up:
src/testing.c 89.08% <100.00%> (+0.02%) :arrow_up:
src/if_xcmdsrv.c 76.07% <0.00%> (-0.72%) :arrow_down:
src/message.c 80.77% <0.00%> (-0.23%) :arrow_down:
src/regexp_nfa.c 89.98% <0.00%> (-0.17%) :arrow_down:
src/term.c 73.67% <0.00%> (-0.16%) :arrow_down:
src/netbeans.c 72.74% <0.00%> (-0.08%) :arrow_down:
src/terminal.c 77.01% <0.00%> (-0.06%) :arrow_down:
src/window.c 88.37% <0.00%> (-0.06%) :arrow_down:
src/drawscreen.c 80.07% <0.00%> (-0.03%) :arrow_down:
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov[bot] avatar Jul 30 '22 13:07 codecov[bot]

Hm, probably under CI there are no keyboard layouts available? That would explain why this test hangs under C I. No idea if layouts can be configured under CI somehow.

ant0sha avatar Jul 30 '22 14:07 ant0sha