Scancode
RawKeyCode = Scancode()
 
Parameters: NONE
Returns:

    RawKeyCode = The RAW KEY value of pressed key
 

      The Scancode function returns the current pressed (if any) RAW KEY value from keyboard. It's important to understand that the returned values, are NOT ASC II characters, but rather the raw codes that your keyboard uses to distinguish between each key. So each key upon the keyboard has a has it's own unique scancode value.




FACTS:


      * ScanCode values are NOT characters codes.



Mini Tutorial:


      This example reads the Scancode being pressed, displays it and then shows how to check for the various SHIFT,ALT and CTRL combinations.

  
  Do
     Cls RGB(0,0,0)
     
   ; Read the Keyboard for the current raw key press
     ThisKey     =ScanCode()
     
   ; Display the current raw key press.
     Print "Current Scan Code:"+Str$(ThisKey)
     Print "Current Scan Code in Binary:"+Bin$(ThisKey)
     
     
   ; Display the raw press with shift/ctrl combinations removed
     Print "Scan Code without combos:"+Str$(ThisKey And %11111111)
     
   ; Display the Screen and loop back to do to continue the program.
     Sync
  Loop
  



 
Related Info: BreakKey | Inkey$ | KeyBoardState | KeyState | Spacekey :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com