-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from hwf1324/v0.4.0
V0.4.0
- Loading branch information
Showing
7 changed files
with
79 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from contextlib import contextmanager | ||
from typing import Callable | ||
|
||
import appModuleHandler | ||
import controlTypes | ||
from NVDAObjects import UIA | ||
from textInfos import UNIT_LINE, UNIT_PARAGRAPH | ||
|
||
|
||
@contextmanager | ||
def restrictParagraphToLine(): | ||
import config | ||
|
||
try: | ||
curTextUnit = config.conf["mouse"]["mouseTextUnit"] | ||
if curTextUnit == UNIT_PARAGRAPH: | ||
config.conf["mouse"]["mouseTextUnit"] = UNIT_LINE | ||
yield | ||
finally: | ||
config.conf["mouse"]["mouseTextUnit"] = ( | ||
curTextUnit or config.conf.getConfigValidation(("mouse", "mouseTextUnit")).default | ||
) | ||
|
||
|
||
class AppModule(appModuleHandler.AppModule): | ||
|
||
def event_mouseMove(self, obj: UIA.UIA, nextHandler: Callable[[], None], x: int, y: int) -> None: | ||
if obj.role == controlTypes.Role.TERMINAL: | ||
with restrictParagraphToLine(): | ||
nextHandler() | ||
return | ||
nextHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# mouseEnhancement add-on for NVDA | ||
# This file is covered by the GNU General Public License. | ||
# See the file COPYING.txt for more details. | ||
# Copyright (C) 2025 hwf1324 <[email protected]> | ||
|
||
import controlTypes | ||
import globalPluginHandler | ||
|
||
|
||
class GlobalPlugin(globalPluginHandler.GlobalPlugin): | ||
|
||
def chooseNVDAObjectOverlayClasses(self, obj, clsList): | ||
try: | ||
if ( | ||
( | ||
obj.windowClassName == "Microsoft.UI.Content.DesktopChildSiteBridge" | ||
or obj.windowClassName == "Windows.UI.Composition.DesktopWindowContentBridge" | ||
) | ||
and obj.role == controlTypes.Role.PANE | ||
and not obj.appModule.isGoodUIAWindow(obj.windowHandle) | ||
): | ||
obj.appModule.isGoodUIAWindow = lambda hwnd: True | ||
except AttributeError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,13 @@ def _(arg): | |
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager | ||
"addon_description": _("""This add-on provides enhancement to mouse functionality in NVDA. | ||
For example, fixed mouse tracking in Electron app (2024.4 only). | ||
Electron apps, such as VS Code."""), | ||
For example: | ||
Fixed mouse tracking in Electron app (2024.4 only). | ||
Electron apps, such as VS Code. | ||
Experimental fix for mouse tracking in WinUI apps. | ||
WinUI applications: e.g. Windows Terminal, PowerToys v0.86.0 and higher, some applications that come with Windows, etc."""), | ||
# version | ||
"addon_version": "0.3.0", | ||
"addon_version": "0.4.0", | ||
# Author(s) | ||
"addon_author": "hwf1324 <[email protected]>", | ||
# URL for the add-on documentation support | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
* Change the add-on name to: Mouse Enhancement. (Doesn't take into account add-on upgrades.) | ||
* Ignore the error when entering the security screen because the object does not have the windowClassName attribute. | ||
* Mouse tracking can report the description of the option in the Git for Windows installer. (Individual options cannot be viewed individually.) | ||
* Experimental: Fix mouse tracking in WinUI apps by making `obj.appModule.isGoodUIAWindow` always return `True` when an object with a specific `windowClassName` property is encountered. | ||
* Windows Terminal: If the text unit is a paragraph, moving the mouse in the Terminal control restricts the text unit to lines. | ||
* Electron: cleaned up some unnecessary judgment logic. | ||
* Update add-on template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters