Komponent FisHotkey - key

0

Witam.

Pobrałem komponent FisHotkey z http://www.delphi-central.com/components/hotkey.aspx

Aby móc go używać trzeba znać kody do przyciskow (nie standardowo np. VK_F9).

Wie ktoś skąd można te kody wziąć ?

Pozdrówka

0

Znalazłem to wcześniej. Oczywiście nie działa.

Przykładowo Ctrl+D to 16452

Kawałek z source:

procedure TfisHotKey.RegisterKey;
var
  lVKey: word;
  lvShift: TShiftstate;
  lModifier: UINT;
begin
  if not prRegistered then
  begin
    lModifier := MOD_SHIFT;
    ShortcutToKey(FHotkey, lvKey, lvShift);
    if lvShift = [ssShift] then lModifier := MOD_SHIFT;
    if lvShift = [ssAlt] then lModifier := MOD_ALT;
    if lvShift = [ssCtrl] then lModifier := MOD_CONTROL;
    prRegistered := RegisterHotKey(prWindow.Handle, 0,
                    lModifier, LOBYTE(lVKey));
  end;
end;

Nie wiem czy dobrze wyciągnąłem ale ten key jest w systemie (?) word.
Ale nigdzie nie mogę znaleźć jak ten kod wyciągnąć.

0

Jest coś takiego jak TextToShortCut(), dodaj tylko do uses Menus.

0
unit Key_value;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    HotKey1: THotKey;
    procedure HotKey1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.HotKey1Change(Sender: TObject);
begin
Form1.Caption:=IntToStr(HotKey1.HotKey);
end;

end.

dodanie znacznika <code class="delphi"> - furious programming

1 użytkowników online, w tym zalogowanych: 0, gości: 1