my <C-Up> / <C-Down> do not work in the popup, but they do in the normal mapping.
" test.vim
function s:popup_filter(winid, key) abort
if a:key ==# "\<C-Up>"
call win_execute(a:winid, "normal! \<c-y>")
elseif a:key ==# "\<C-Down>"
call win_execute(a:winid, "normal! \<c-e>")
elseif a:key ==# "\<C-k>"
call win_execute(a:winid, "normal! \<c-y>")
elseif a:key ==# "\<C-j>"
call win_execute(a:winid, "normal! \<c-e>")
elseif a:key ==# 'q'
call popup_close(a:winid)
endif
return v:true
endfunction
call range(1, 20)
\ ->map({_, i -> string(i)})
\ ->popup_create({
\ 'close': 'button',
\ 'minwidth': 50,
\ 'maxwidth': 50,
\ 'minheight': 5,
\ 'maxheight': 5,
\ 'border': [],
\ 'mapping': v:false,
\ 'filter': funcref('s:popup_filter'),
\ 'filtermode': 'n'
\ })
noremap <C-Up> :echomsg "CTRL-Up"<CR>
noremap <C-Down> :echomsg "CTRL-Down"<CR>