How to detect gamepad or mouse in a widget?

this doesn’t work