Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
w-sx committed May 15, 2024
1 parent beeef38 commit 942f443
Show file tree
Hide file tree
Showing 21 changed files with 1,160 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Try to ensure that po files in the repo does not include
# source code line numbers.
# Every person expected to commit po files should change their personal config file as described here:
# https://mail.gnome.org/archives/kupfer-list/2010-June/msg00002.html
*.po filter=cleanpo
64 changes: 64 additions & 0 deletions .github/workflows/build_addon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: build addon

on:
push:
tags: ["*"]
# To build on main/master branch, uncomment the following line:
branches: [ main , master ]

pull_request:
branches: [ main, master ]

workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- run: echo -e "pre-commit\nscons\nmarkdown">requirements.txt

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y gettext
- name: Code checks
run: export SKIP=no-commit-to-branch; pre-commit run --all

- name: building addon
run: scons

- uses: actions/upload-artifact@v3
with:
name: packaged_addon
path: ./*.nvda-addon

upload_release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: ["build"]
steps:
- uses: actions/checkout@v3
- name: download releases files
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R

- name: Release
uses: softprops/action-gh-release@v1
with:
files: packaged_addon/*.nvda-addon
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, '-') }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
addon/doc/*.css
addon/doc/en/
*_docHandler.py
*.html
manifest.ini
*.mo
*.pot
*.py[co]
*.nvda-addon
.sconsign.dblite
/[0-9]*.[0-9]*.[0-9]*.json
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-yaml
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
"ms-python.flake8"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"editor.accessibilitySupport": "on",
"flake8.args": [
"--config=flake8.ini"
],
"flake8.importStrategy": "fromEnvironment",
"python.autoComplete.extraPaths": [
"../nvda/source",
"../nvda/miscDeps/python"
],
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.insertSpaces": false,
"python.analysis.stubPath": "${workspaceFolder}/.vscode/typings",
"python.analysis.extraPaths": [
"../nvda/source",
"../nvda/miscDeps/python"
],
"python.defaultInterpreterPath": "${workspaceFolder}/../nvda/.venv/scripts/python.exe"
}
6 changes: 6 additions & 0 deletions .vscode/typings/__builtins__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def _(msg: str) -> str:
...


def pgettext(context: str, message: str) -> str:
...
105 changes: 103 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,103 @@
# virtualKeyboard
A NVDA Addon, Emulate various keyboards, including numeric keypads, extended function keyboards, and multimedia keyboards.
# virtual keyboard

**Simulates various keyboards, including numeric keyboards, extended function keyboards, and multimedia keyboards**

* Author: Shunxian Wu [email protected]

* Compatibility: NVDA-2022.1 or later

## Overview

This plugin provides several virtual keyboard modes, including numpad mode, function key extension mode, and multimedia keyboard mode.

When the virtual keyboard is open and running, some keys will be simulated as other keys.

Keys that may be involved include:

* 7 8 9

* y u i o p [ ]

* h j k l ; '

* m , . /

Switching to different virtual keyboard modes may use different keyboard keys. You can use NVDA keyboard help to get familiar with the virtual keyboard layout.

## Hotkeys

* NVDA+- (minus sign), turn on/off the virtual keyboard. Do not modify the hotkey arbitrarily to avoid conflicts with virtual keyboard keys

* Left bracket [ , switch to the previous mode when the virtual keyboard is open

* Right bracket ], switch to the next mode when the virtual keyboard is open

* RightControl, pause or resume the virtual keyboard when the virtual keyboard is open

## Numpad Mode Key Mapping Table

Note: The following is the key mapping when the virtual keyboard is enabled and switched to numpad mode

* Keyboard 7, 8, 9 correspond to numpad 7, 8, 9

* Keyboard u, i, o correspond to numpad 4, 5, 6

* Keyboard j, k, l correspond to numpad 1, 2, 3

* Keyboard m, comma, period correspond to numpad 0, period, enter

* Keyboard y, p correspond to numpad slash, asterisk

* Keyboard h, semicolon correspond to numpad plus, minus

* Keyboard slash corresponds to numpad Num Lock

The recommended fingering is to place the right thumb on the m key, the index, middle, and ring fingers on the u, i, and o keys, and the little finger on the p key.

Using the above fingering, you can easily perform one-handed operations in the virtual numpad area.

When the virtual keyboard is open, you can press the RightControl key at any time to pause or resume the virtual keyboard. Once the virtual keyboard is paused, all keys except RightControl are restored to their original state.

## Function Key Extension Mode & Applied Media Extension Mode

In these two modes, some uncommon function keys are mapped.

This is for setting up simple and quick hotkeys for easy use in setting up single-key hotkeys or hotkeys that can be executed with just NVDA modifiers in input and gestures.

For specific key mappings, press NVDA+keyboard number 1 to open input help, switch to the corresponding mode, and click on the corresponding key to view.

## Additional Tips

When change the hotkey to turn on/off the virtual keyboard, please avoid the keys involved in the virtual keyboard.

Specifically, this includes:

7, 8, 9

y, u, i, o, p, left bracket, right bracket

h, j, k, l, semicolon, single quote

n, m, comma, period, slash

If you must set a hotkey related to the above keys, you can press RightControl before turning off the virtual keyboard.

## Changelog

2024.5

Merged numpad digits mode and numpad hotkey mode into numpad mode, switching with Num Lock

Added internationalization support

2024.4

Compatible with NVDA 2024.1

2023.3.27

Added Applied Media Keyboard, which can be used to implement functions such as next/previous song, volume up/down, and browser operations.

At the request of users, the mapping of the virtual keyboard enter key has been modified and added, corresponding to the comma key in numpad mode. The volume of the prompt for pausing/resuming the virtual keyboard has been increased.

Corrected errors in the help file, hopefully no other errors.
103 changes: 103 additions & 0 deletions addon/doc/zh_cn/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 虚拟键盘

**模拟各种键盘,包括数字键盘、扩展功能键盘、多媒体键盘**

* 作者: Shunxian Wu [email protected]

* 兼容性: NVDA-2022.1 或更高版本

## 供能概述

本插件提供了几套虚拟键盘模式,包括小键盘模式、功能键扩展模式和多媒体键盘模式。

当虚拟键盘打开并运行时,部分按键将被模拟为其他按键。

可能涉及的按键如下:

* 7 8 9

* y u i o p [ ]

* h j k l ; '

* m , . /

切换到不同的虚拟键盘模式可能占用不同的键盘按键,可使用 NVDA 键盘帮助熟悉虚拟键盘布局。

## 快捷键

* NVDA+- (减号),开关虚拟键盘。快捷键请勿随意修改,避免与虚拟键盘键位冲突

* 左方括号 ,虚拟键盘打开状态下,切换到上一个模式

* 右方括号 ,虚拟键盘打开状态下,切换到下一个模式

* 右Control ,虚拟键盘打开状态下,暂停或恢复虚拟键盘

## 小键盘模式键位对应表

注:以下所述均为虚拟键盘开启状态下,切换到小键盘模式的按键对应关系

* 键盘7、8、9,对应小键盘7、8、9

* 键盘u、i、o,对应小键盘4、5、6

* 键盘j、k、l,对应小键盘1、2、3

* 键盘m、逗号、点,对应小键盘0、点、回车

* 键盘y、p,对应小键盘斜杠、星号

* 键盘h、分号,对应小键盘加、减

* 键盘斜杠,对应小键盘数字锁定键

推荐指法为右手大指置于m键,食、中、无名指置于u、i、o键,小指置于p键

按照以上指法,可以很轻松地完成虚拟小键盘区域的单手操作。

虚拟键盘打开状态下,随时可以按下右Control键,暂停或恢复虚拟键盘。虚拟键盘暂停后,除右Control外,其它各键均处于还原状态。

## 功能键扩充模式 & 应用媒体扩展模式

在这两个模式下,映射了一些不常用的功能键。

为设置简易快捷键留作备用,便于在输入与手势中设置单键或仅加NVDA修饰即可执行的快捷键。

具体的键位对应关系,可按NVDA+键盘数字1打开输入帮助,切换到相应模式,点击相应按键查看。

## 附加提示

修改开关虚拟键盘的快捷键时,请避开虚拟键盘中涉及的按键。

具体而言,包括:

7、8、9

y、u、i、o、p、左方括号、右方括号

h、j、k、l、分号、单引号

n、m、逗号、点、斜杠

如果一定要设置为与上述按键相关的快捷键,关闭虚拟键盘前可按下右Control。

更新日志

2024.5

合并小键盘数字模式与小键盘热键模式为小键盘模式,通过数字锁定键切换

添加了国际化支持

2024.4

兼容 NVDA 2024.1

2023.3.27

添加了应用媒体键盘,可以通过该键盘实现上下一曲、音量增减、浏览器操作等功能。

应用户来信要求,修改并添加了小键盘回车键的映射,对应数字键盘模式下的逗号键。增大了暂停/恢复虚拟键盘的提示音量。

更正了帮助文件中的错误,希望没有别的错误了。
Loading

0 comments on commit 942f443

Please sign in to comment.