This information cannot be read directly from the Bluetooth interface. Instead, the generic input event interface in Linux is used, which makes all ‘Human Interface Device (HID)’ devices available to all applications.
This is also the case in Windows and is done, of course, to ensure that the application with input focus always receives the corresponding key events.