[fpc-devel](no subject)

rstar at mnet-online.de rstar at mnet-online.de
Fri Jan 2 14:25:57 CET 2004


I have a problem with the different key codes identifiers. I would 
suggest a carnonical key code
like shown below. According to used platform/component-library the 
dedicated key codes are always
being mapped to the same identifier Key_<name>.


//Kylix Qt  :  Key_Return     = 4100;
//Microsoft :  VK_RETURN      = 13;
//Lazarus   :  key_Return     = 13;
//GTK       :  GDK_KEY_Return = $FF0D;

{$IFDEF MsWindows}
const
   Key_Return  = Windows.vk_Return;
   Key_Escape  = Windows.vk_Escape;
   Key_Space   = Windows.vk_Space;
   Key_C       = Windows.vk_Cancel;
   Key_Up      = Windows.vk_Up;
   Key_Down    = Windows.vk_Down;
   Key_Prior   = Windows.vk_Prior;
   Key_Next    = Windows.vk_Next;
   Key_Left    = Windows.vk_Left;
   Key_Right   = Windows.vk_Right;
   Key_Home    = Windows.vk_Home;
   Key_End     = Windows.vk_End;
{$ENDIF}

{$IFDEF FPC_Linux}
const
   Key_Return  = VCLGlobals.key_Return;
   Key_Escape  = VCLGlobals.key_Escape;
   Key_Space   = -0;//???
   Key_C       = -1;//???
   Key_Up      = VCLGlobals.key_Up;
   Key_Down    = VCLGlobals.key_Down;
   Key_Prior   = -2;//???
   Key_Next    = -3;//???
   Key_Left    = VCLGlobals.key_Left;
   Key_Right   = VCLGlobals.key_Right;
   Key_Home    = VCLGlobals.key_Home;
   Key_End     = VCLGlobals.key_End;
{$ENDIF}

...









More information about the fpc-devel mailing list