How do I temporarily prevent buttons to wake up screen? Typically if any key on the [bluetooth] keyboard is pressed, except of volume-up, volume-down and such, Android turns on it's screen.

How do I make other keys behave like volume control keys (i.e. not wake up the device)? I want to bind other functions to them and don't want Android itself to react on them?
Root the device;
Install Xposed framework;
Install Xposed Additions;
Enable Xposed Additions in Xposed Framework, restart the device;
Open Xposed Additions setup;
Buttons -> Allow External Devices -> Keyboard;
Add new Key -> Press the button you wan to disable on the keyboard -> OK -> Go to the newly appeared menu entry for the button you have chosen -> Add new Condition -> Screen Off -> Screen Off -> Click.


You will see "Click - Disabled" and the key won't work and won't wake up the device anymore.

You can also reassign it to some other key instead of disabling.