Giter VIP home page Giter VIP logo

Comments (13)

H1DDENADM1N avatar H1DDENADM1N commented on August 15, 2024 3

需要安装:autohotkey V2

我把它封装exe并加到GUI里了,跟随start_client_gui.exe一起启动停止,美滋滋🥰

from capswriter-offline.

photkey avatar photkey commented on August 15, 2024 1

自己折腾了一个,虽然效果不完美,但是比没有还是好一些的,这个效果还可以
capswriter

from capswriter-offline.

HaujetZhao avatar HaujetZhao commented on August 15, 2024

键盘上的 caps lock 状态灯,不就是指示吗,如果按下亮起,松开灭掉,那就是表明录音成功

from capswriter-offline.

photkey avatar photkey commented on August 15, 2024

caps lock 状态灯 只能确认是否按下capslock键,无法确认CapsWriter已启动 且当前正在语音输入状态,也无法确认当前输入位置;我觉得capslock状态灯 不能解决这个需求;而且看状态灯 需要低头看。

from capswriter-offline.

photkey avatar photkey commented on August 15, 2024

主要是没有这个状态提示,没有反馈,心里不踏实;如果按下按键就弹出图标提示,会有个即时的反馈,我觉得体验是会更好一些的。

from capswriter-offline.

HaujetZhao avatar HaujetZhao commented on August 15, 2024

在可见的未来两年内,我无法添加图形提示

from capswriter-offline.

H1DDENADM1N avatar H1DDENADM1N commented on August 15, 2024

@photkey 试试我这个,在tray有图标会不会安心点 #53

start_server_and_client_in_tray

from capswriter-offline.

photkey avatar photkey commented on August 15, 2024

@photkey 试试我这个,在tray有图标会不会安心点 #53

@H1DDENADM1N 你这个项目挺好的,用起来挺方便,但是对我这个需求帮助不大,一个是看托盘图标还是不够方便,另外一个是对于这个用途来说 跟下图的托盘图标其实效果也差不太多
Snipaste_2024-01-23_04-37-47

期待你的GUI 能更新更多功能。

from capswriter-offline.

H1DDENADM1N avatar H1DDENADM1N commented on August 15, 2024

自己折腾了一个,虽然效果不完美,但是比没有还是好一些的,这个效果还可以

capswriter

哇,这效果不错,代码能发下吗?

from capswriter-offline.

photkey avatar photkey commented on August 15, 2024

哇,这效果不错,代码能发下吗?

#Requires AutoHotkey v2.0
CoordMode("ToolTip", "Screen")


~CapsLock::{
    if hwnd := GetCaretPosEx(&x, &y, &w, &h){
        ; 能够获取到文本光标时,提示信息在光标位置,且x坐标向右偏移5
        x := x + 5
    }
    else{
        ; 获取不到文本光标时,提示信息在当前窗口的位置
        WinGetPos &X, &Y, &W, &H, "A"
        x := X + W * 0.25
        y := Y + H * 0.7
    }
    ToolTip("✦语音输入中‧‧‧", x, y) ; 提示信息内容
    KeyWait("CapsLock")
    ToolTip()
    return
}


GetCaretPosEx(&x?, &y?, &w?, &h?) {
    x := h := w := h := 0
    static iUIAutomation := 0, hOleacc := 0, IID_IAccessible, guiThreadInfo, _ := init()
    if !iUIAutomation || ComCall(8, iUIAutomation, "ptr*", eleFocus := ComValue(13, 0), "int") || !eleFocus.Ptr
        goto useAccLocation
    if !ComCall(16, eleFocus, "int", 10002, "ptr*", valuePattern := ComValue(13, 0), "int") && valuePattern.Ptr
        if !ComCall(5, valuePattern, "int*", &isReadOnly := 0) && isReadOnly
            return 0
    useAccLocation:
    ; use IAccessible::accLocation
    hwndFocus := DllCall("GetGUIThreadInfo", "uint", DllCall("GetWindowThreadProcessId", "ptr", WinExist("A"), "ptr", 0, "uint"), "ptr", guiThreadInfo) && NumGet(guiThreadInfo, A_PtrSize == 8 ? 16 : 12, "ptr") || WinExist()
    if hOleacc && !DllCall("Oleacc\AccessibleObjectFromWindow", "ptr", hwndFocus, "uint", 0xFFFFFFF8, "ptr", IID_IAccessible, "ptr*", accCaret := ComValue(13, 0), "int") && accCaret.Ptr {
        NumPut("ushort", 3, varChild := Buffer(24, 0))
        if !ComCall(22, accCaret, "int*", &x := 0, "int*", &y := 0, "int*", &w := 0, "int*", &h := 0, "ptr", varChild, "int")
            return hwndFocus
    }
    if iUIAutomation && eleFocus {
        ; use IUIAutomationTextPattern2::GetCaretRange
        if ComCall(16, eleFocus, "int", 10024, "ptr*", textPattern2 := ComValue(13, 0), "int") || !textPattern2.Ptr
            goto useGetSelection
        if ComCall(10, textPattern2, "int*", &isActive := 0, "ptr*", caretTextRange := ComValue(13, 0), "int") || !caretTextRange.Ptr || !isActive
            goto useGetSelection
        if !ComCall(10, caretTextRange, "ptr*", &rects := 0, "int") && rects && (rects := ComValue(0x2005, rects, 1)).MaxIndex() >= 3 {
            x := rects[0], y := rects[1], w := rects[2], h := rects[3]
            return hwndFocus
        }
        useGetSelection:
        ; use IUIAutomationTextPattern::GetSelection
        if textPattern2.Ptr
            textPattern := textPattern2
        else if ComCall(16, eleFocus, "int", 10014, "ptr*", textPattern := ComValue(13, 0), "int") || !textPattern.Ptr
            goto useGUITHREADINFO
        if ComCall(5, textPattern, "ptr*", selectionRangeArray := ComValue(13, 0), "int") || !selectionRangeArray.Ptr
            goto useGUITHREADINFO
        if ComCall(3, selectionRangeArray, "int*", &length := 0, "int") || length <= 0
            goto useGUITHREADINFO
        if ComCall(4, selectionRangeArray, "int", 0, "ptr*", selectionRange := ComValue(13, 0), "int") || !selectionRange.Ptr
            goto useGUITHREADINFO
        if ComCall(10, selectionRange, "ptr*", &rects := 0, "int") || !rects
            goto useGUITHREADINFO
        rects := ComValue(0x2005, rects, 1)
        if rects.MaxIndex() < 3 {
            if ComCall(6, selectionRange, "int", 0, "int") || ComCall(10, selectionRange, "ptr*", &rects := 0, "int") || !rects
                goto useGUITHREADINFO
            rects := ComValue(0x2005, rects, 1)
            if rects.MaxIndex() < 3
                goto useGUITHREADINFO
        }
        x := rects[0], y := rects[1], w := rects[2], h := rects[3]
        return hwndFocus
    }
    useGUITHREADINFO:
    if hwndCaret := NumGet(guiThreadInfo, A_PtrSize == 8 ? 48 : 28, "ptr") {
        if DllCall("GetWindowRect", "ptr", hwndCaret, "ptr", clientRect := Buffer(16)) {
            w := NumGet(guiThreadInfo, 64, "int") - NumGet(guiThreadInfo, 56, "int")
            h := NumGet(guiThreadInfo, 68, "int") - NumGet(guiThreadInfo, 60, "int")
            DllCall("ClientToScreen", "ptr", hwndCaret, "ptr", guiThreadInfo.Ptr + 56)
            x := NumGet(guiThreadInfo, 56, "int")
            y := NumGet(guiThreadInfo, 60, "int")
            return hwndCaret
        }
    }
    return 0
    static init() {
        try
            iUIAutomation := ComObject("{E22AD333-B25F-460C-83D0-0581107395C9}", "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}")
        hOleacc := DllCall("LoadLibraryW", "str", "Oleacc.dll", "ptr")
        NumPut("int64", 0x11CF3C3D618736E0, "int64", 0x719B3800AA000C81, IID_IAccessible := Buffer(16))
        guiThreadInfo := Buffer(A_PtrSize == 8 ? 72 : 48), NumPut("uint", guiThreadInfo.Size, guiThreadInfo)
    }
}

需要安装:autohotkey V2

from capswriter-offline.

H1DDENADM1N avatar H1DDENADM1N commented on August 15, 2024

需要安装:autohotkey V2

感谢,用上了,发现新天地呀

from capswriter-offline.

Cirsth avatar Cirsth commented on August 15, 2024

需要安装:autohotkey V2

我把它封装exe并加到GUI里了,跟随start_client_gui.exe一起启动停止,美滋滋🥰

好像有个BUG,运行start.exe的时候hint_while_recording.exe并不会自动启停,要单独运行start_client_gui.exe才行。

from capswriter-offline.

H1DDENADM1N avatar H1DDENADM1N commented on August 15, 2024

好像有个BUG,运行start.exe的时候hint_while_recording.exe并不会自动启停,要单独运行start_client_gui.exe才行。

就是这样设计的,start.exe调用的start.py就没写启停hint_while_recording.exe相关功能的代码😂。
另转录功能相关的代码也是只有start_client_gui.exe才有哈。
这里有提到 服务端、客户端分离 的原因。start.exe也不会再更新加入更多功能。
不过如果有需要你可以自己修改下start.py,把相关代码段抄过去。

from capswriter-offline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.