Einzelnen Beitrag anzeigen

Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#8

AW: Hotkey wert aus Shortcut lesbar und zurück

  Alt 6. Nov 2018, 13:30
Also das auslesen klappt perfekt.
(SLI ist ein Record fürs LinkFile)
Delphi-Quellcode:
    edHotKey.Text := '';
    HotKeyMod := Hi( SLI.HotKey );
    cbALT.Checked := (HotKeyMod and HOTKEYF_ALT) = HOTKEYF_ALT;
    cbCTRL.Checked := (HotKeyMod and HOTKEYF_CONTROL) = HOTKEYF_CONTROL;
    cbSHIFT.Checked := (HotKeyMod and HOTKEYF_SHIFT) = HOTKEYF_SHIFT;
    edHotKey.Text := ShortcutToText( SLI.HotKey );
so sind die checkboxen korrekt gesetzt, im edHotKey.Text steht nur der Key.
aber beim schreiben stell ich mich noch zu dumm an
Delphi-Quellcode:
    HotKeyMod := 0;
    if cbALT.Checked then HotKeyMod := ( HotKeyMod and HOTKEYF_ALT );
    if cbCTRL.Checked then HotKeyMod := ( HotKeyMod and HOTKEYF_CONTROL );
    if cbSHIFT.Checked then HotKeyMod := ( HotKeyMod and HOTKEYF_SHIFT );
    SLI.HotKey := ( Hi( HotKeyMod ) and Lo( TextToShortcut( edHotKey.Text ) ) );
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat