Simulate the pressing of keyboard keys[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 safef8 的 blog

1. postkeyex32 function}

procedure postkeyex32(key: word; const shift: tshiftstate; specialkey: boolean);
{************************************************************
* procedure postkeyex32
*
* parameters:
*  key    : virtual keycode of the key to send. for printable
*           keys this is simply the ansi code (ord(character)).
*  shift  : state of the modifier keys. this is a set, so you
*           can set several of these keys (shift, control, alt,
*           mouse buttons) in tandem. the tshiftstate type is
*           declared in the classes unit.
*  specialkey: normally this should be false. set it to true to
*           specify a key on the numeric keypad, for example.
* description:
*  uses keybd_event to manufacture a series of key events matching
*  the passed parameters. the events go to the control with focus.
*  note that for characters key is always the upper-case version of
*  the character. sending without any modifier keys will result in
*  a lower-case character, sending it with [ssshift] will result
*  in an upper-case character!
// code by p. below
************************************************************}
type
  tshiftkeyinfo = record
    shift: byte;
    vkey: byte;
  end;
  byteset = set of 0..7;

本文关键:Simulate the pressing of keyboard keys
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top