Redesigned part of keyboard event handler in RazerManager.