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

Added numpad support #51

Merged

Conversation

robtoyota
Copy link
Contributor

@robtoyota robtoyota commented Mar 5, 2020

Description

Added support for the numpad. I created a dict in WordCatcher.__init__ method called self._vk_map to map the pynput Key vk value to specific characters. For example virtual key code 97 maps to numpad 1, and keycode 110 maps to numpad ..

Then in WordCatcher._keycode_to_keydata I added a mapping of the key code (self._key.vk) to that self._vk_map dict.

Fixes #
42 - Numerical text files not loading: #42

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  1. Create a new textblock called #test0123456789.txt, and populate it with test text.
  2. Run text-script, or !reload if it is already running.
  3. Type #test and then use the numpad to type 0123456789 with the numpad.
  4. Ensure that the shortcut is expanded to the full textblock.
  5. Repeat step 3 and 4, but using the numbers at the top of the keyboard, to ensure regular numbers still work.

Test Configuration:

  • OS: Windows 10
  • IDE: N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@GeorgeCiesinski GeorgeCiesinski self-assigned this Mar 5, 2020
@GeorgeCiesinski GeorgeCiesinski added the bug Something isn't working label Mar 5, 2020
@GeorgeCiesinski GeorgeCiesinski added this to the 1.3.1 Bugfix milestone Mar 5, 2020
@GeorgeCiesinski
Copy link
Owner

Fully tested, all existing functions seem unaffected, new functionality tested and working. Thanks Robbie, I'm merging this into develop.

@GeorgeCiesinski GeorgeCiesinski merged commit 519120d into GeorgeCiesinski:develop Mar 5, 2020
@robtoyota robtoyota deleted the feature/numpad_support branch March 5, 2020 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants