Input code update: - add keycode mapping helpers to core. - start switching devices to new input api. - misc bugfixes.