more work on lib/keyboard.js...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
made next/prev ribbon actions behave in a stable manner...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>