This example tests the keyboard state of the active session.
Sub Main()
Dim Sys As Object, Sess As Object
Set Sys = CreateObject("EXTRA.System")
' Assumes an open session
Set Sess = Sys.ActiveSession
If Sess.KeyboardLocked Then
MsgBox "The keyboard is locked."
Else
MsgBox "The keyboard is not locked."
End If
End Sub