get the topmost viewscreen and then feed() the relevant keys to it.
I've been doing that :
CoreSuspender s; //not sure if this is needed in that context
auto screen = Core::getInstance().getTopViewscreen();
std::set<df::interface_key>keys;
keys.insert(df::interface_key::A_MOVE_UP);
screen->feed(&keys);
This compiles fine and runs smoothly in the main loop.
But I have some big issues:1. As you said, one must send keybinding codes. I'd like something more generic, like "up keyboard arrow" or "down keyboard arrow", to make the code work with most viewscreens (including non-standard plugins that cannot be foreseen) without requiring to implement a billion things. By now, the code is very intricate, I fail to find a more global keystroke injection method (in df::ui, maybe?).
2. Even if I went for the actual key binding: I'd need to know the meaning of each key binding (declared in the big-ass list in "interface_key.h"). There is a billion of them, and they're not commented. Some make sense because they are prefixed with an intuitive viewscreen's name (e.g. ORDERS_) but
I fail to find, for example, the "pause" keybinding from the main DF window (space bar). OK bad example, that was an easy one. They're the ones prefixed with "D_". But my question still stands: anyone has a tip to be more flexible with that giant list?
3. In some cases I need to indentify the current viewscreen, and here again it's hard to identify them from the class name : e.g. "viewscreen_buildingst.h" is explicit, but I fail to identify the main viewscreen (the one with "building", "units", etc.). All those .h files are generated. Generated from what? And how?
Yes, I know, that's a lot of questions!

I promise, the pestering will stop soon.
PS: the more I learn, th emore stuff I find to add in the tutorial, that's a great exercise for newbies!