USB Keyboard as an input to control lights

So,

Is it possible to connect a usb keyboard to a raspberry pi 3 running hassio to control some light?

If I press 1 on the keyboar, they turn on, if i press 2 they turn off.

I’m trying to follow this https://home-assistant.io/components/keyboard_remote/ but without any success :frowning:

I could be wrong, but I don’t think that will work with Hass.io since HA is running in a container.

What about hassbian? Can i use a keyboard with hassbian?