Recent

Author Topic: Function keys  (Read 5319 times)

nspur

  • New member
  • *
  • Posts: 5
Function keys
« on: April 24, 2008, 09:05:55 pm »
The keyboard on my i386 machine has function keys. I've just started looking at Lazarus for Windows and Ubuntu and have ported a small Delphi app which functions after a fashion. BUT it reles to an extent on the user being able to use the function keys. Obviously I can't use the Windows constants (VK_F1 etc) but is there any way to trap the pressing of a function key? And if so what file do I need to include for the constants?

cyber_python

  • Jr. Member
  • **
  • Posts: 79
RE: Function keys
« Reply #1 on: April 24, 2008, 10:14:56 pm »
Maybe you can use some info from here(don't really know if these codes work) : http://delphi.about.com/od/objectpascalide/l/blvkc.htm

nspur

  • New member
  • *
  • Posts: 5
RE: Function keys
« Reply #2 on: April 24, 2008, 10:45:12 pm »
In the Delphi program I did use the virtual key-codes. Maybe I can use the decimal equivalents.

cyber_python

  • Jr. Member
  • **
  • Posts: 79
RE: Function keys
« Reply #3 on: April 24, 2008, 10:55:26 pm »
Please, post back here the results (so that if it works others can find the info on the forum)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8114
  • Programming + Glam Metal + Tae Kwon Do = Me
RE: Function keys
« Reply #4 on: April 25, 2008, 04:08:37 am »
Quote
what file do I need to include for the constants?

Code: [Select]

uses
  LCLType;

nspur

  • New member
  • *
  • Posts: 5
Re: RE: Function keys
« Reply #5 on: April 25, 2008, 12:14:25 pm »
Quote from: "Leledumbo"
Quote
what file do I need to include for the constants?

Code: [Select]

uses
  LCLType;


Many thanks for that. I did put the constants I needed into a new unit and that worked as well.