The control needs to be defined in application logic, so the application must let PocketHAL know whether it is acceptable to change the orientation and remap keys.
Don't worry about the sliding keyboard - just assume any orientation change as reported through WM_SETTINGCHANGE. In fact, probably don't even need to worry about that - just if device reports back different orientation different to last frame then there needs to be a way for the application to say whether it should allow PocketHAL to auto adjust according to the change as well.
The issue I'm trying to work around is that some screens in the application are designed for only landscape and don't make sense changing orientation even if the user slides the keyboard out - just want to keep it in portrait as if nothing happened.
At the moment I have my code responding to a WM_SETTINGCHANGE message to check if the shell orientation has changed, and if so I recreate the Display object with the currently reported orientation. I can't remember why I do that - it might have been for pre-1.03 when keys weren't auto remapped? Is there actually a need to recreate the Display object on orientation change? Perhaps if I didn't do that it would just carry on as per normal anyhow?
Does that sound right? Could I just ignore WM_SETTINGCHANGE and not recreate the Display for when I want orientation preserved, but leave current functionality for when I want auto orientation awareness? In which case PHAL doesn't need any change, just the way I'm working with it.