Currently Inkscape always use keys group 0 as a Latin layout for hotkeys processing. This is wrong because of keys groups indexes is depends on keymap implementation.
In this patch I've added searching appropriate keys group at runtime. This is done by analysing keymap entries for Latin 'a' key. When keymap has multiply entries for Latin 'a' key the group with minimal index value selected.
After this fix hotkeys is working on Ubuntu 16.04 and Ubuntu 17.10 Beta 2 with multiply keyboard layouts.