xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_KeyPut()

Puts an inkey code into the keyboard buffer.

Syntax

HB_KeyPut( <nInkeyCode> ) --> NIL

Arguments

<nInkeyCode>
This is a numeric Inkey() code to add to the keyboard buffer. #define constants from the file Inkey.ch can be used for <nInkeyCode>. The numeric value Zero is ignored.

Return

The return value is always NIL.

Description

Function HB_KeyPut() extends the KEYBOARD command and allows for adding numeric Inkey() codes to the keyboard buffer whose values are outside the range of 1 to 255.

HB_KeyPut() adds <nInkeyCode> to the keyboard buffer without removing pending keys from the buffer. The function can add only one Inkey() code at a time. To add multiple key codes, the function must be called repeatedly.

Info

See also:KEYBOARD, CLEAR TYPEAHEAD, Inkey()
Category: Keyboard functions
Header:inkey.ch
Source:rtl\inkey.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example outlines the difference between the KEYBOARD command
// and HB_KeyPut() with an Inkey() code greater than 255

   #include "Inkey.ch"

   PROCEDURE Main

      ? K_ALT_PGDN                // result: 417

      KEYBOARD Chr( K_ALT_PGDN )

      ? Inkey()                   // result: 161
      ? Asc( Chr( K_ALT_PGDN ) )  // result: 161

      HB_KeyPut( K_ALT_PGDN )

      ? Inkey()                   // result: 417

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe