For future generations coming to look for this.
Newer versions of Unreal (~4.27+) have the CommonInput Subsystem which takes care of input events and device changes. You can simply bind an event to the input change like this:
and the delegate will give you the device. You can also get the current input type and many other things.
As a subsystem this is accessible from anywhere without having to add any components and it should work in UI as well as any other code classes.