HotKeyConfig.pas 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. unit HotKeyConfig;
  2. interface
  3. uses
  4. BaseConfig, InterfaceConfig;
  5. type
  6. THotkeyConfig = class(TBaseConfig, IHotkeyConfig)
  7. private
  8. protected
  9. procedure New; override;
  10. public
  11. constructor Create(); override;
  12. function GetCopyScreen: string;
  13. function GetReadMessage: string;
  14. function GetSendMessage: string;
  15. procedure SetCopyScreen(const Value: string);
  16. procedure SetReadMessage(const Value: string);
  17. procedure SetSendMessage(const Value: string);
  18. property ReadMessage: string read GetReadMessage write SetReadMessage;
  19. property CopyScreen: string read GetCopyScreen write SetCopyScreen;
  20. property SendMessage: string read GetSendMessage write SetSendMessage;
  21. end;
  22. implementation
  23. { THotkeyConfig }
  24. constructor THotkeyConfig.Create;
  25. begin
  26. ConfigType := ctUser;
  27. FileName := 'hotkey.json';
  28. inherited;
  29. end;
  30. function THotkeyConfig.GetCopyScreen: string;
  31. begin
  32. Result := Data.S['copyScreen']
  33. end;
  34. function THotkeyConfig.GetReadMessage: string;
  35. begin
  36. Result := Data.S['readMessage'];
  37. end;
  38. function THotkeyConfig.GetSendMessage: string;
  39. begin
  40. Result := Data.S['sendMessage'];
  41. end;
  42. procedure THotkeyConfig.New;
  43. begin
  44. inherited;
  45. Data.S['readMessage'] := 'CTRL+ALT+R';
  46. Data.S['copyScreen'] := 'CTRL+ALT+C';
  47. Data.S['sendMessage'] := 'SHIFT+ENTER';
  48. end;
  49. procedure THotkeyConfig.SetCopyScreen(const Value: string);
  50. begin
  51. Data.S['copyScreen'] := Value;
  52. end;
  53. procedure THotkeyConfig.SetReadMessage(const Value: string);
  54. begin
  55. Data.S['readMessage'] := Value;
  56. end;
  57. procedure THotkeyConfig.SetSendMessage(const Value: string);
  58. begin
  59. Data.S['sendMessage'] := Value;
  60. end;
  61. end.