1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
| procedure TCustomHotKey.ShortCutToHotKey(Value: TShortCut); begin FHotKey := Value and not (scShift + scCtrl + scAlt); FModifiers := []; if Value and scShift <> 0 then Include(FModifiers, hkShift); if Value and scCtrl <> 0 then Include(FModifiers, hkCtrl); if Value and scAlt <> 0 then Include(FModifiers, hkAlt); end;
function TCustomHotKey.HotKeyToShortCut(Value: Longint): TShortCut; begin Byte(FModifiers) := LoWord(HiByte(Value)); FHotKey := LoWord(LoByte(Value)); Result := FHotKey; if hkShift in FModifiers then Inc(Result, scShift); if hkCtrl in FModifiers then Inc(Result, scCtrl); if hkAlt in FModifiers then Inc(Result, scAlt); end; |