keyboard: api improvements