diff --git a/App-ScreenRotate.ahk b/App-ScreenRotate.ahk deleted file mode 100644 index eddca09..0000000 --- a/App-ScreenRotate.ahk +++ /dev/null @@ -1,183 +0,0 @@ - -; SnowstarCyan_Monitor_Libriay -; Updates: -; 2016y 01m 28d -; Created By Snowstar (SnowstarCyan@gmail.com) -; For rotate my screens to play computer games on bed at winter. ~(≧▽≦)~ - -; API Functions -ChangeDisplaySettingsA := DllCall("User32.dll\ChangeDisplaySettingsA", "Ptr", &lpDevMode, "Int", dwflags) -ChangeDisplaySettingsExA := DllCall("User32.dll\ChangeDisplaySettingsExA", "Str", DeviceName, "Ptr", &lpDevMode, "Ptr", HWND, "Int", dwflags, "Ptr", lParam) -EnumDisplaySettingsA := DllCall("User32.dll\EnumDisplaySettingsA", "Str", DeviceName, "Int", iModeNum, "Ptr", &lpDevMode) -EnumDisplayDevicesA := DllCall("User32.dll\EnumDisplayDevicesA", "Str", DeviceName, "Int", iDevNum, "Ptr", &lpDevMode, "Int", dwflags) - -class DEVMODE_DISPLAY_DEVICE { - __New() { - this.dmSize := 156 - this.dmFields := 0 - } - __Set(key, value) { - if (key == "position_x") || (key == "position_y") - this.dmPosition := &value - else - this[key] := value - } -} - -class DISPLAY_DEVICE { - __New() { - this.cb := 424 - } -} - -_DISPLAY_DEVICE_ATTACHED_TO_DESKTOP := 1 - -Monitor := {} - -Monitor.MapByFunc := Func("MapByFunc") -Monitor.Merge := Func("Merge") -Monitor.GetDevMode := Func("GetDevMode") -Monitor.GetDeviceName := Func("GetDeviceName") -Monitor.RotateDevMode90 := Func("RotateDevMode90") -Monitor.ApplyDevMode := Func("ApplyDevMode") -Monitor.GetDisplayDevices := Func("GetDisplayDevices") -Monitor.RotateOneMonitor := Func("RotateOneMonitor") -Monitor.RotateAllMonitor := Func("RotateAllMonitor") - -MapByFunc(tab, func, params*) { - newtab := {} - for k, v in tab { - newtab[k] := %func%(v, params*) - } - return newtab -} - -Merge(tab1, tab2) { - newtab := {} - for k, v in tab1 { - if (tab1[k] && tab2[k]) { - newtab.push([tab1[k], tab2[k]]) - } - } - return newtab -} - -GetDevMode(deviceName) { - devMode := new DEVMODE_DISPLAY_DEVICE() - success := DllCall("User32.dll\EnumDisplaySettingsA", "Str", deviceName, "Int", -1, "Ptr", devMode) - if (!success) { - MsgBox Can't get current settings. - return null - } - return devMode -} - -GetDeviceName(device) { - return device.DeviceName -} - -RotateDevMode90(devMode, devModeMain) { - New_Orientation := Mod(devMode.displayOrientation + 1, 4) - - ; Calculate new positions - New_position_x := (devModeMain ? devModeMain.pelsHeight - devMode.position_y - devMode.pelsHeight : devMode.position_y) - New_position_y := devMode.position_x - New_pelsWidth := devMode.pelsHeight - New_pelsHeight := devMode.pelsWidth - - devMode.position_x := New_position_x - devMode.position_y := New_position_y - devMode.pelsWidth := New_pelsWidth - devMode.pelsHeight := New_pelsHeight - devMode.displayOrientation := New_Orientation - - return devMode -} - -ApplyDevMode(deviceToDevmode) { - deviceName := deviceToDevmode[1] - devMode := deviceToDevmode[2] - success := DllCall("User32.dll\ChangeDisplaySettingsExA", "Str", deviceName, "Ptr", devMode, "Ptr", 0, "Int", 0, "Ptr", 0) - return success -} - -GetDisplayDevices() { - lsDisplayDevice := [] - iDevNum := 0 - Loop { - lpDisplayDevice := new DISPLAY_DEVICE() - if !DllCall("User32.dll\EnumDisplayDevicesA", "Str", Null, "Int", iDevNum, "Ptr", lpDisplayDevice, "Int", 0) { - break - } - if (lpDisplayDevice.StateFlags & _DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) { - lsDisplayDevice.Push(lpDisplayDevice) - } - iDevNum++ - } - return lsDisplayDevice -} - -RotateOneMonitor(degree, abs := false, deviceName := "") { - devMode := Monitor.GetDevMode(deviceName) - if !devMode { - return - } - - rotCount := Mod((Floor(degree / 90)), 4) - if abs { - rotCount := Mod(rotCount - devMode.displayOrientation, 4) - } - Loop %rotCount% { - devMode := Monitor.RotateDevMode90(devMode) - } - - success := Monitor.ApplyDevMode([deviceName, devMode]) - return success -} - -RotateAllMonitor(degree, abs := false) { - lsDevice := Monitor.GetDisplayDevices() - lsDeviceName := Monitor.MapByFunc(lsDevice, Monitor.GetDeviceName) - - lsDevMode := Monitor.MapByFunc(lsDeviceName, Monitor.GetDevMode) - if !lsDevMode[1] { - MsgBox You can't rotate the `non-screen` - return - } - - rotCount := Mod((Floor(degree / 90)), 4) - if abs { - rotCount := Mod(rotCount - lsDevMode[1].displayOrientation, 4) - } - Loop %rotCount% { - lsDevMode := Monitor.MapByFunc(lsDevMode, Monitor.RotateDevMode90, lsDevMode[1]) - } - - lsDeviceToDevmode := Monitor.Merge(lsDeviceName, lsDevMode) - lsSuccess := Monitor.MapByFunc(lsDeviceToDevmode, Monitor.ApplyDevMode) - return lsSuccess -} - -Monitor.RotateOneMonitor(90) -MsgBox, % GetDisplayDevices().length -return - -#^p:: ScreenRotate() -ScreenRotate(){ - - ; Unit Test - Monitor.RotateOneMonitor(90) - Sleep, 3000 - Monitor.RotateOneMonitor(0, true) - Sleep, 3000 - Monitor.RotateAllMonitor(-90) - Sleep, 3000 - Monitor.RotateAllMonitor(180) - Sleep, 3000 - Monitor.RotateAllMonitor(90, true) - Sleep, 3000 - Monitor.RotateAllMonitor(-90, true) - Sleep, 3000 - Monitor.RotateAllMonitor(0, true) - Sleep, 3000 -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 3700c6d..3c67ce6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.34.4](https://github.com/snolab/CapsLockX/compare/v1.34.3...v1.34.4) (2024-11-02) + + +### Bug Fixes + +* **Lib:** lib ([187f7bb](https://github.com/snolab/CapsLockX/commit/187f7bb2a80a6aaa2b53eb11d2d257fa6a9a4d6b)) +* **Modules:** brainstorm bug ([ea13c9c](https://github.com/snolab/CapsLockX/commit/ea13c9c9a60b20fd7c77cfb2825cae56e20bc145)) +* **Modules:** windowmanager ([61ca5e5](https://github.com/snolab/CapsLockX/commit/61ca5e5485907821fc4b285048aca66a1fb67d2c)) + ### [1.34.3](https://github.com/snolab/CapsLockX/compare/v1.34.2...v1.34.3) (2024-08-22) diff --git a/Core/CapsLockX-i18n.ahk b/Core/CapsLockX-i18n.ahk index 3db9f69..2db43f7 100644 --- a/Core/CapsLockX-i18n.ahk +++ b/Core/CapsLockX-i18n.ahk @@ -1,21 +1,20 @@ - -global CLX_Lang := CLX_Config("Core", "Language", "auto", "语言切换") +global CLX_Lang := CLX_Config("Core", "Language", "auto", "语言切换") global CLX_i18nConfigPath := "Core/lang.ini" global CLX_i18n_newTranslated := "Core/lang.ini" 清洗为_UTF16_WITH_BOM_型编码(CLX_i18nConfigPath) ; - [Language Codes \| AutoHotkey v1]( https://www.autohotkey.com/docs/v1/misc/Languages.htm ) -LCID_7804 := "Chinese" ; zh +LCID_7804 := "Chinese" ; zh LCID_0004 := "Chinese (Simplified)" ; zh-Hans LCID_0804 := "Chinese (Simplified, China)" ; zh-CN LCID_1004 := "Chinese (Simplified, Singapore)" ; zh-SG -LCID_7C04 := "Chinese (Traditional)" ; zh-Hant -LCID_0C04 := "Chinese (Traditional, Hong Kong SAR)" ; zh-HK -LCID_1404 := "Chinese (Traditional, Macao SAR)" ; zh-MO -LCID_0404 := "Chinese (Traditional, Taiwan)" ; zh-TW -LCID_0011 := "Japanese" ; ja -LCID_0411 := "Japanese (Japan)" ; ja-JP +LCID_7C04 := "Chinese (Traditional)" ; zh-Hant +LCID_0C04 := "Chinese (Traditional, Hong Kong SAR)" ; zh-HK +LCID_1404 := "Chinese (Traditional, Macao SAR)" ; zh-MO +LCID_0404 := "Chinese (Traditional, Taiwan)" ; zh-TW +LCID_0011 := "Japanese" ; ja +LCID_0411 := "Japanese (Japan)" ; ja-JP ; TODO: converts t(s, lang := "") @@ -30,7 +29,7 @@ t(s, lang := "") ; run node "prompts/translate-en.md" if (lang == ""){ lang := CLX_Lang - } + } if (!lang) { lang := "auto" } @@ -83,7 +82,7 @@ i18n_translated(lang, key) return translated } - question := key . "`n`nTry translate to " . lang + question := "TASK: translate to " . lang . ",dont explain, just translate`n" . "ORIGIN TEXT: " . key global brainstorm_origin if (!brainstorm_origin) { diff --git a/Core/clipboard-image-OLD.jpg b/Core/clipboard-image-OLD.jpg new file mode 100644 index 0000000..ff5b7ac Binary files /dev/null and b/Core/clipboard-image-OLD.jpg differ diff --git a/Core/clipboard-image.jpg b/Core/clipboard-image.jpg new file mode 100644 index 0000000..cf3dc6a Binary files /dev/null and b/Core/clipboard-image.jpg differ diff --git a/Core/version.txt b/Core/version.txt index 51dd29b..ee3723e 100644 --- a/Core/version.txt +++ b/Core/version.txt @@ -1 +1 @@ -1.34.3 \ No newline at end of file +1.34.4 \ No newline at end of file diff --git a/DevTools/choco/CapsLockX.nuspec b/DevTools/choco/CapsLockX.nuspec index c532d87..871ab2e 100644 --- a/DevTools/choco/CapsLockX.nuspec +++ b/DevTools/choco/CapsLockX.nuspec @@ -2,7 +2,7 @@ CapsLockX - 1.34.3 + 1.34.4 snomiao snomiao Copyright (C) Snowstar Laboratory 2017-2024 @@ -65,6 +65,15 @@ You can also write your own my-ahk.user.ahkand put it ./User/in the directory, C All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.34.4](https://github.com/snolab/CapsLockX/compare/v1.34.3...v1.34.4) (2024-11-02) + + +### Bug Fixes + +* **Lib:** lib ([187f7bb](https://github.com/snolab/CapsLockX/commit/187f7bb2a80a6aaa2b53eb11d2d257fa6a9a4d6b)) +* **Modules:** brainstorm bug ([ea13c9c](https://github.com/snolab/CapsLockX/commit/ea13c9c9a60b20fd7c77cfb2825cae56e20bc145)) +* **Modules:** windowmanager ([61ca5e5](https://github.com/snolab/CapsLockX/commit/61ca5e5485907821fc4b285048aca66a1fb67d2c)) + ### [1.34.3](https://github.com/snolab/CapsLockX/compare/v1.34.2...v1.34.3) (2024-08-22) @@ -108,11 +117,7 @@ All notable changes to this project will be documented in this file. See [standa * **capslockx:** i18n setup ([5ac5047](https://github.com/snolab/CapsLockX/commit/5ac5047bd4ad5c8205c402af8711aeb8c4611dd1)) * **capslockx:** initial locales ([68b61e8](https://github.com/snolab/CapsLockX/commit/68b61e811404967b0bb58e377905e5f3094a42b9)) * **capslockx:** initial-langs ([38335b9](https://github.com/snolab/CapsLockX/commit/38335b96f8c4adaaae78960ace27177915a607bb)) -* **capslockx:** lang codes ([bb79216](https://github.com/snolab/CapsLockX/commit/bb7921651d076324641fa2a980c7650f5c4fce58)) -* **capslockx:** not default start ([d538603](https://github.com/snolab/CapsLockX/commit/d538603c4f538902e1389638694964367bfb4d21)) -* **CapsLockX:** remove pnpm ([791262d](https://github.com/snolab/CapsLockX/commit/791262d65f2aa7ffe9696ec7533890e0b1a69e98)) -* **capslockx:** tr error ([c70b891](https://github.com/snolab/CapsLockX/commit/c70b8919ab38f4951b26263cef3b19175f618ea4)) -* **capslockx:** xflymsg ([6052549](https://github.com/snolab/CapsLockX/commit/605254966310d0c0f57138a54383ca39ff8760c7))]]> +* **capslockx:** lang codes ([bb79216](https://github.com/snolab/CapsLockX/commit/bb7921651d076324641fa2a980c7650f5c4fce58))]]> diff --git a/README.md b/README.md index c46825d..a31f351 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,17 @@ Enhance keyboard operations for OneNote 2016 - 2019, enabling convenient use of #### Keyboard Layout Design ( + + +### Screen Rotate + +Usage + +1. Open a window in OneNote 2016 with the title "Clipboard Collection". +2. When you copy something using Ctrl + C, it will automatically be saved in OneNote. +3. As shown in the image + ![Plugin - OneNote Clipboard Collector.gif](./docs/media/Plugin-OneNote Clipboard Collector.gif) + ### iFlytek Input Method Floating Window Plugin diff --git a/package.json b/package.json index 6aa6688..4c1b7b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "capslockx", - "version": "1.34.3", + "version": "1.34.4", "description": "CapsLockX 提供一套超好上手的:鼠标模拟、编辑增强、虚拟桌面与窗口管理、应用内热键增强、JS数学表达式计算、等超多功能等你来定义。", "keywords": [ "CapsLockX"