I have seen several otherwise inexplicable glitches fixed by changing a hub and a decade or so ago I came to the conclusion that inexpensive or bargain USB hubs were neither inexpensive nor a bargain in the long run. On the other hand, there is no guarantee a new hub will fix your keyboard problem.
Before spending any more money my suggestion would be to plug the keyboard directly into the computer and completely disconnecting the hub.
- If the problem continues to exist then it has to be the keyboard.
- If the problem disappears when the hub is completely out of the loop, then it has to be involved in the issue.
- Before getting rid of the hub try a new USB cable between your iMac and the hub, then if the problem still exists it is definitely time to replace the hub.