The following code finds the state of the caps lock key with the help of the door library:
B4X:
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
obj.New1(False)
obj.CreateNew("System.Windows.Forms.Control" & obj.System_Windows_Forms)
Msgbox(getCapsLockState)
End Sub
Sub getCapsLockState As Boolean
Return obj.RunMethod2("IsKeyLocked", "CapsLock", "System.Windows.Forms.Keys" & obj.System_Windows_Forms)
End Sub