Use ring buffer for keyboard buffer.