better keyboard handling in prototype