generated from nvdaaddons/AddonTemplate
-
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.
Setup basic repo structure and files.
- Loading branch information
Luke Davis
authored and
Luke Davis
committed
May 1, 2024
1 parent
17625ae
commit 92a68ed
Showing
8 changed files
with
197 additions
and
186 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
.github/workflows/check-for-extended-ascii-and-utf-bom.yaml
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,33 @@ | ||
name: Check that we dont have extended ascii or utf boms in our files | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- prime | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
- prime | ||
|
||
jobs: | ||
extendedAsciiAndBom: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: check for files known to cause problems | ||
run: find . -type f | grep -vP "^./.git" | xargs file | grep -iP "bom|extended|iso" | ||
- name: | ||
if: failure() | ||
uses: unsplash/comment-on-pr@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
msg: "Please note that this push or pull request seems to contain files other than ascii or utf8 without bom." |
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,29 @@ | ||
name: Lint | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: [push, pull_request] | ||
# push: | ||
# branches: | ||
# - master | ||
# pull_request: | ||
# branches: | ||
# - master | ||
|
||
jobs: | ||
lint: | ||
runs-on: windows-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Lint | ||
run: flake8 addon |
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,26 @@ | ||
# https://crontab.guru/crontab.5.html | ||
|
||
name: Check for and merge l10n updates | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '08 00 * * 6' # At 00:08 on Saturdays | ||
|
||
jobs: | ||
update-translations: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout master | ||
uses: actions/checkout@v3 | ||
- name: Merge changes | ||
run: | | ||
git config --global user.name github-actions | ||
git config --global user.email github-actions@github.com | ||
git pull | ||
git remote add l10n https://github.com/nvdaaddons/speechLogger | ||
git fetch l10n | ||
git merge -q --ff -m "Translations automerge" l10n/stable | ||
git push | ||
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,76 @@ | ||
# Ignore special keys | ||
# Originally a private add-on by Tyler Spivey <tspivey@pcdesk.net>, on behalf of Sarah k Alawami <marrie12@gmail.com> | ||
# With a subsequent rewrite and expansion by Luke Davis <XLTechie@newanswertech.com>. | ||
# Copyright (c) 2023-2024, Sarah k Alawami, Luke Davis, all rights reserved. | ||
|
||
import config | ||
import gui | ||
import ui | ||
import addonHandler | ||
import globalPluginHandler | ||
import keyboardHandler | ||
import tones | ||
import winUser | ||
import winInputHook | ||
from scriptHandler import script | ||
from logHandler import log | ||
from globalCommands import SCRCAT_TOOLS | ||
|
||
|
||
addonHandler.initTranslation() | ||
globalPluginPointer: Optional[globalPluginHandler.GlobalPlugin] = None | ||
|
||
config.conf.spec["ignoreSpecialKeys"] = { | ||
"resetSelectedLockKeys": "boolean(default=True)", | ||
"keyGroup": "integer(default=0)", | ||
} | ||
|
||
class GlobalPlugin(globalPluginHandler.GlobalPlugin): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.patched = False | ||
global globalPluginPointer | ||
globalPluginPointer = self | ||
|
||
def patch(self): | ||
if self.patched: | ||
return | ||
else: | ||
self.old_fn = keyboardHandler.internal_keyDownEvent | ||
keyboardHandler.internal_keyDownEvent = internal_keyDownEvent | ||
winInputHook.keyDownCallback = internal_keyDownEvent | ||
self.patched = True | ||
tones.beep(1000, 100) | ||
|
||
def unpatch(self, shouldBeep: bool = True): | ||
if self.patched: | ||
keyboardHandler.internal_keyDownEvent = self.old_fn | ||
winInputHook.keyDownCallback = self.old_fn | ||
self.patched = False | ||
if shouldBeep: | ||
tones.beep(700, 100) | ||
|
||
def terminate(self): | ||
self.unpatch(False) | ||
|
||
@script( | ||
description="Toggle to keep NVDA from intercepting foot pedal keys. Press again to restore normal keyboard.", | ||
gesture="kb:NVDA+shift+f8", | ||
category=SCRCAT_TOOLS | ||
) | ||
def script_patch(self, gesture): | ||
if self.patched: | ||
self.unpatch() | ||
else: | ||
self.patch() | ||
|
||
def internal_keyDownEvent(vkCode, scanCode, extended, injected): | ||
if ( | ||
vkCode == winUser.VK_PAUSE | ||
or vkCode == winUser.VK_CANCEL | ||
or vkCode == winUser.VK_SCROLL | ||
): | ||
return True | ||
else: | ||
return globalPluginPointer.old_fn(vkCode, scanCode, extended, injected) |
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
Oops, something went wrong.