What you describe above, works perfectly for me at AOK.^^ If I remember right, it is not important You still can press 0 (to show military buildings) and then press 4 to build a house anyway (no matter that you`re on a military buildings "page" ) Opposite it works the same - you can be on the economical buildings "page", and still press 1 to build a stable.
So, whether you press economical or military buildings hotkey first - it`s not important, it works the same, the only difference is that you`ll see either economical or military buildings in the villager build menu, but you can still build either by pressing the assigned hotkey.
But in AOC it is not working for some weird reason.
It only builds economical or military buildings NOT both