How do I get keyboard events in user widget?

How do I tell it to replace the mapping instead of simply adding another one?