[fpc-pascal] Keyboard unit under Linux
fmccormick at videotron.ca
Thu Oct 18 02:23:56 CEST 2007
On Thu, 18 Oct 2007 01:20:31 +0200
Michalis Kamburelis <michalis.kambi at gmail.com> wrote:
> Frank McCormick wrote:
> > Resending because of some changes in my results.
> > I am having a tough time using the keyboard unit under Linux. Please tell me
> > whats wrong with this code:
> > ( var section cut out)
> > Begin
> > InitKeyBoard;
> > Repeat
> > K:=pollKeyEvent;
> > if k <>0
> > then
> > begin
> > k:=getkeyevent;
> > k:=translatekeyevent(k);
> > if isfunctionkey(k)
> > then
> > case k Of
> Replace above line with "case GetKeyEventCode(k) Of". To compare with
> constants like kbdF1 and such, you have to extract event code from
> TKeyEvent value by GetKeyEventCode (somewhat analogous to
> GetKeyEventChar that you use below).
Bingo. That did it. Is it just me or is this keyboard stuff unnecessarily
complicated under Linux ?
Thanks for spotting that!!
Change the world one loan at a time - visit Kiva.org to find out how
More information about the fpc-pascal