Tablet Mode: How to Query?

I’d like the display of my web app to be aware of the hinge on a Samsung laptop (Chromebook but could be any convertible), and display visible undo/redo buttons if the laptop is open to tablet mode (thus disabling the keyboard).

Is there a query for this?

thanks