Inkey$
Key$ = Inkey$()
 
Parameters: NONE
Returns:

    Key$ = The ASC II character that represent the pressed key
 

      The Inkey$ function returns the current key pressed in string form.



FACTS:


      * Inkey$ can not return special keys like CTRL,SHIFT,Enter,Function keys etc, as these key have no valid ASC II character.

      * Inkey$ can only return single key presses




Mini Tutorial:


      This example uses Inkey$ to create a very basic input function

  
  
  Do
     Cls RGB(0,0,0)
     
   ; Read the Keyboard for the current key pressed
     ThisChr$     =Inkey$()
     
   ; Add this current key press to our TYPEDTEXT string
     TypedText$=Typedtext$+ThisChr$
        
      ; If this chr press was different from the last
      ; key press set the LASTCHR$ variable to remember it
        If ThisChr$<>""
           If ThisChr$<>lastCHr$
              LastChr$=ThisChr$
           EndIf
        EndIf
        
      ; Display the Characters that been typed so far
        Print "Typed Text:"+TypedText$
      ; Display the last pressed Key
        Print "Last Key pressed ("+LastChr$+")"
        
      ; Display the Screen and wait for the user to press a key
        Sync
     Loop
     
     



 
Related Info: Input | Scancode | StaticInput :
 


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