Yes, using the GET KEY STATE function:
do
print get key state( 0x90 )
loop
The values are:
0 - off
1 - on
-127 - being switched on
-128 - being switched off
... or if you are familiar with binary:
bit 0 - the on/off bit
bit 7 - the key down bit (1 if currently down)
[edit]It occurred to me that it may be helpful to also post a link to a list of the keycodes:
http://msdn.microsoft.com/en-us/library/ms927178.aspx
The list contains hex values, but if you prefix them with '0x' as I have in the short piece of code I posted, then you can use them directly.