(AGK version: 108.13)
Submitted: 2013-06-16 14:30:15
Setvirtualresolution(640,480)
SetPrintSize(25)
//Create a Quit Button if tested on an actual device.
AddVirtualButton(1,580,400,80)
SetVirtualButtonText(1,"QUIT")

Repeat

    result=GetOrientation()

    select result
        case 1:
            print ( "portrait mode" )
        endcase
        case 2:
            print ( "portrait mode - 180 degrees rotation" )
        endcase
        case 3:
            print ( "landscape mode - 90 degrees counterclockwise" )
        endcase
        case 4:
            print ( "landscape mode - 90 degrees clockwise" )
        endcase
    endselect

    Sync()
Until GetVirtualButtonPressed(1)=1
End
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.