diff --git a/README.RU.md b/README.RU.md index da294f4..6bf1477 100644 --- a/README.RU.md +++ b/README.RU.md @@ -3,6 +3,9 @@ # Центр уведомлений Альтернативный центр уведомлений для Windows. Совместимо с [уведомлениями для программ](https://github.com/r57zone/notifications). +## Настройка +Для включения мигания светодиодом клавиатуры (Scroll Lock-ом), изменить параметр `ScrollBlink` на `1` в файле "Config.ini". + ## Скриншоты ![](https://user-images.githubusercontent.com/9499881/36250925-cb506156-1258-11e8-8c31-e52e8bbed1fa.png) diff --git a/README.md b/README.md index bc6f435..14683d5 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ # Notification center Alternative notification center for Windows. Compatible with [notifications for programs](https://github.com/r57zone/notifications). +# Setup +To enable blinking of the keyboard LED (Scroll Lock), change the `ScrollBlink` parameter to` 1` in the "Config.ini" file. + ## Screenshots ![](https://user-images.githubusercontent.com/9499881/36250978-fbbba1c0-1258-11e8-8ef8-c3ec62ac554f.png) diff --git a/Source/Unit1.dfm b/Source/Unit1.dfm index dce4892..af2702d 100644 --- a/Source/Unit1.dfm +++ b/Source/Unit1.dfm @@ -62,7 +62,7 @@ object Main: TMain Left = 104 Top = 8 Bitmap = { - 494C010101000400040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000001000000001002000000000000010 000000000000000000000000000000000000000000FF000000FF000000FF0000 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 @@ -198,7 +198,8 @@ object Main: TMain FC3F000000000000F81F00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - FFFF000000000000FFFF000000000000} + FFFF000000000000FFFF00000000000000000000000000000000000000000000 + 000000000000} end object ItemsPopupMenu: TPopupMenu Left = 72 diff --git a/Source/Unit1.pas b/Source/Unit1.pas index 7cf480f..1b86e98 100644 --- a/Source/Unit1.pas +++ b/Source/Unit1.pas @@ -36,6 +36,7 @@ TMain = class(TForm) procedure BlockBtnClick(Sender: TObject); procedure ShowBtnClick(Sender: TObject); procedure ChangeIconTimer(Sender: TObject); + procedure PressScroll; private procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA; procedure WMNCHITTEST(var Msg: TMessage); message WM_NCHITTEST; @@ -62,6 +63,7 @@ TMain = class(TForm) IDS_NOTIFICATIONS, IDS_DELETE_ALL, IDS_UNKNOWN_APP, IDS_BLOCK_QUESTION, IDS_LAST_UPDATE: string; RunOnce: boolean; NotifyIndex: integer; + ScrollBlink, ScrollState: boolean; implementation @@ -121,7 +123,15 @@ procedure TMain.IconMouse(var Msg: TMessage); begin case Msg.LParam of WM_LBUTTONDOWN: - if IsWindowVisible(Main.Handle) then NotificationCenterHide else NotificationCenterShow; + begin + if IsWindowVisible(Main.Handle) then + NotificationCenterHide + else + NotificationCenterShow; + + if ScrollState then + PressScroll; + end; WM_RBUTTONDOWN: PopupMenu.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y); @@ -187,11 +197,14 @@ procedure TMain.FormCreate(Sender: TObject); Reg: TRegistry; begin Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'Config.ini'); + ScrollBlink:=Ini.ReadBool('Main', 'ScrollBlink', false); IconIndex:=Ini.ReadInteger('Main', 'NewMessages', 0); // "" - if IconIndex = 1 then + if IconIndex = 1 then begin ChangeIcon.Enabled:=true; + PressScroll; + end; if Ini.ReadBool('Main', 'FirstRun', true) then begin Ini.WriteBool('Main', 'FirstRun', false); @@ -340,6 +353,8 @@ procedure TMain.WMCopyData(var Msg: TWMCopyData); '5': NotifyColor:='#8b0094'; '6': NotifyColor:='#ac193d'; '7': NotifyColor:='#222222'; + else + NotifyColor:='#018399'; end; // @@ -350,6 +365,7 @@ procedure TMain.WMCopyData(var Msg: TWMCopyData); Tray(3); // "" ChangeIcon.Enabled:=true; + PressScroll; Notifications.SaveToFile(ExtractFilePath(ParamStr(0)) + 'Notifications.txt'); end; @@ -377,6 +393,8 @@ procedure TMain.FormDestroy(Sender: TObject); ExcludeList.Free; Tray(2); IconFull.Free; + if ScrollState then + PressScroll; end; procedure TMain.DefaultHandler(var Message); @@ -388,10 +406,10 @@ procedure TMain.DefaultHandler(var Message); procedure TMain.AboutBtnClick(Sender: TObject); begin - Application.MessageBox(PChar(Application.Title + ' 0.7.4' + #13#10 - + IDS_LAST_UPDATE + ' 25.12.2020' + #13#10 - + 'http://r57zone.github.io' + #13#10 + 'r57zone@gmail.com'), - PChar(AboutBtn.Caption), MB_ICONINFORMATION); + Application.MessageBox(PChar(Application.Title + ' 0.7.5' + #13#10 + + IDS_LAST_UPDATE + ' 05.03.2021' + #13#10 + + 'https://r57zone.github.io' + #13#10 + + 'r57zone@gmail.com'), PChar(AboutBtn.Caption), MB_ICONINFORMATION); end; procedure TMain.ExitBtnClick(Sender: TObject); @@ -442,7 +460,17 @@ procedure TMain.ChangeIconTimer(Sender: TObject); IconIndex:=1 else IconIndex:=0; + PressScroll; Tray(3); end; +procedure TMain.PressScroll; +begin + if ScrollBlink = false then + Exit; + keybd_event(VK_SCROLL, VK_SCROLL, KEYEVENTF_EXTENDEDKEY, 0); + keybd_event(VK_SCROLL, VK_SCROLL, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); + ScrollState:=not ScrollState; +end; + end.