V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Geo200
V2EX  ›  macOS

macOS 多显示器鼠标光标切换方案推荐

  •  
  •   Geo200 · Jun 26, 2023 · 1325 views
    This topic created in 1044 days ago, the information mentioned may be changed or developed.

    2 个以上的显示器如果使用鼠标、触摸板对光标移动都存在距离太长的问题,目前有没有工具可以实现快捷键实现光标在显示器间切换?

    cxtrinityy
        1
    cxtrinityy  
       Jun 26, 2023   ❤️ 2
    hammerspoon, 写下 lua 就可以, 我双屏互切就这么写的, 你多屏可以自己多写几个对应的:

    hs.hotkey.bind({"ctrl", "cmd"}, "x", function()
    local cs = hs.mouse.getCurrentScreen()
    local screens = hs.screen.allScreens()
    if cs:id() ~= screens[1]:id() then
    -- hs.alert.show("not in mac screen")
    local cmod = screens[1]:currentMode();
    hs.mouse.setRelativePosition({x = cmod["w"] / 2, y = cmod["h"] / 2},
    screens[1])
    else
    -- hs.alert.show("in mac screen")
    local cmod = screens[2]:currentMode();
    hs.mouse.setRelativePosition({x = cmod["w"] / 2, y = cmod["h"] / 2},
    screens[2])
    end
    end)
    Geo200
        2
    Geo200  
    OP
       Jun 26, 2023
    @cxtrinityy 有效,我顺便学习下!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2806 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:18 · PVG 16:18 · LAX 01:18 · JFK 04:18
    ♥ Do have faith in what you're doing.