Touch-It Virtual Keyboard Version 4.9.2
Windows messages

Windows message WM_TOUCHITLIGHT parameters are:

  • wParam: Light code
  • lParam: On/Off

Interface

var

WM_TOUCHITLIGHT :integer;//Variable for unique Windows message ID
Warnings :array[2201..2205] of boolean;//Array used for flashing warnings
FlipFlop :boolean;//Flashing flip-flop


implementation

//************************************************************************************
//The vumeter is driven by the TrackBar1. All lights under a certain value must be ON.

procedure TForm1.TrackBar1Change(Sender: TObject);
var

i :integer;//Loop count

const

FirstLed = 2000;//First light code and number of lights
LedCount = 20;//based on the template designed

begin

for i := 0 to LedCount -1 do

PostMessage(FindWindow(nil, PChar('Touch-It Keyboard')),

WM_TOUCHITLIGHT, FirstLed +i, integer(TrackBar1.Position > i));

end;

//************************************************************************************
//The post-process is driven by the TrackBar2. Only one light is ON at a time.

procedure TForm1.TrackBar1Change(Sender: TObject);
var

i :integer;//Loop count

const

FirstLed = 2100;//First light code and number of lights
LedCount = 20;//based on the template designed

begin

for i := 0 to LedCount -1 do

PostMessage(FindWindow(nil, PChar('Touch-It Keyboard')),

WM_TOUCHITLIGHT, FirstLed +i, integer(TrackBar2.Position = i+1));

end;

//************************************************************************************
//Warnings lights are driven by the CheckBoxes. Flashing is managed in the Timer OnTimer event.

//Change warning states when CheckBoxes are clicked. The Tag property contains the light code.

procedure TForm1.cbPressureClick(Sender: TObject);
begin
with TCheckBox(Sender) do

Warnings[Tag] := Checked;

end;

//Switch ON or OFF
procedure TForm1.Timer1OnTimer(Sender: TObject);
var

i :integer;//Loop count

begin

for i := low(Warnings) to high(Warnings) do

PostMessage(FindWindow(nil, PChar('Touch-It Keyboard')),

WM_TOUCHITLIGHT, i, integer(Warnings[i] and FlipFlop));


FlipFlop := not FlipFlop;

end;

//Retreive the unique Windows message ID
initialization

WM_TOUCHITSHOWHIDE := RegisterWindowMessage('TOUCHITLIGHT');

When starting, Touch-It broadcasts a WM_TOUCHITSTART message which allows you to initialize the lights state. See Windows messages to learn how to trap this message.
Copyright © 2011 Chessware SA