dirkvl: Could you try to attach the NFC sticker on the moving part of your keyboard and check if the NFC ID is readable from the phone when the keyboard is closed. If yes, this could be used to disable the software keyboard, to force a landscape mode or|and to disable the switch off of the display, when the HW keyboard is slided out.