Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能请求:针对无法粘贴文本的编辑框,使用键盘方式输入剪贴板内的文本。 #6

Open
hwf1324 opened this issue Jun 25, 2023 · 1 comment

Comments

@hwf1324
Copy link
Contributor

hwf1324 commented Jun 25, 2023

一些编辑框限制了粘贴行为,但文本可以通过键盘方式输入。

我之前想直接利用 https://github.com/boppreh/keyboard 库中的 write 函数实现此功能,但也许因为它和 NVDA 的键盘处理程序有冲突,所以无法实现。

import api
import globalPluginHandler
import scriptHandler
import ui

from . import keyboard


class GlobalPlugin(globalPluginHandler.GlobalPlugin):

	@scriptHandler.script(
			description=_("Enter the contents of the clipboard from the keyboard."),
			gesture="kb:NVDA+V"
	)
	def script_enterFromClipboard(self, gesture):
		text = api.getClipData()
		if isinstance(text, str):
			keyboard.write(text)
		else:
			ui.message(_("The data in the clipboard is not text."))

而且这个库是跨平台的,需要精简。所以考虑参考此库的实现,配合一些 NVDA 本身的函数。

此功能优先度不高,我考虑研究一段时间来实现它。

@cary-rowen
Copy link
Owner

谢谢,欢迎为此开启一个 PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants