added option to clear action generator, useful when the widget needs to forget all keys that have been pressed and not released. This happens for example when loosing focus.