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

3.0 keyboard shortcut mapping #288

Merged
merged 14 commits into from
Jan 8, 2023
Merged

3.0 keyboard shortcut mapping #288

merged 14 commits into from
Jan 8, 2023

Conversation

luc-github
Copy link
Owner

per @aaronse initial PR for shortcut remapping : #285
Also now allows keys configuration for keyboard shortcut in settings
Also allows shortcuts on macro buttons
Also have better control on auto repeat keys

luc-github and others added 11 commits December 30, 2022 16:09
Implement shortcut conflict managment
Display shortcut help in table instead of div for readibility
Change shorcut list collapsed button to use find instead of index 1
…isrupting typing in Text fields (e.g. Terminal Console) (#285)
Clean up preferences.json
Add shortcut support to Macros panel
Remove shortcut code from JogCNC / JogPlotter
Add autorepeat enable / disable feature for shortcuts keys with autorepeat delay  in settings
Rewrite the shortcut help to display the keys defined according the buttons displayed
Note: CNC and Plotter jog keys are not yet populated => TBD
@luc-github
Copy link
Owner Author

@aaronse please give a try to this PR I have tried to cover most of I can
I will merge it end of this week if no issue / comment for change

@aaronse
Copy link

aaronse commented Jan 2, 2023

Nice! Looks great to me. Great to see key shortcuts enabled for macros now too, that enables a bunch of scenarios...

Not important, but any thoughts on adding an undo button next to the delete button? I guess the user can always refresh page and start over with the key mapping changes they were making. Without an Undo button, they will learn to save regularly to avoid redoing a bunch of edits before they want to undo something. Again, not important, but maybe implementing undo for input fields is useful for other situations too.

Sent small edits in #289 to enable more compact rendering of Key map items. Thoughts?

Thanks again @luc-github. Great to see UI support for keyboard shortcuts for jogging, macros and some other features. Also nice to see Terminal improvements with key shortcuts not disrupting User typing.

@luc-github
Copy link
Owner Author

the reset feature was present in previous UI and actually I removed it because no one seems using it, and it maked UI simpler and code also simpler and lighter.

…el for text input

Remove condition of keymap check for formatItem and put back to generic
@luc-github
Copy link
Owner Author

I will rebuild packages end of this week then

@aaronse
Copy link

aaronse commented Jan 4, 2023

@luc-github encountered some bugs/issues while testing on my actual CNC (SKR Pro) that did not show up during unit testing using Dev box local hosting. Will share more details, still testing, but think some edits and/or release notes might be needed...

@aaronse
Copy link

aaronse commented Jan 4, 2023

problem: Single letter key shortcuts are not working. For example expected pressing 'Z' to home Z axis, actual behavior is nothing happens.

cause:

  1. Preferences.json files were updated with Uppercase character key. But e.key will be lowercase if Shift key is not pressed.
                    {
                        "id": "btnHZ",
                        "name": "btnHZ",
                        "key": "Z"      <-- 'Z' Should be lowercase, and/or, both settings and onkeypress code should be insensitive.
                    },

Some fix ideas :
a) Either, edit all Preferences.json files to instead have lowercase single letter key shortcuts. This fixes the problem today, however, tomorrow many others manually editing preferences.json will run into this and get frustrated too...
b) Or, edit index.js line ~66 to be case insensitive for single key press. So change

keyval += e.key  

to instead be...

keyval += e.key.toUpperCase()  

This will work for most people, maybe Turkish 'i' or some other locales will be impacted IF they specified wrong casing in the preferences.json.

Thinking 'b' is better, other ideas/suggestions?

Adding console log in on key press handling code helps to debug this :-)

    console.log("KeyMap override match, key = " + e.key + ", cmd= " + cmdMatch + ", alt= " + e.altKey);

@luc-github
Copy link
Owner Author

luc-github commented Jan 4, 2023

I was in caps lock that may be why all are upper case
I will move back to lower case, now user can change keys, upper or lower should be user choice no need to upper case

Help reflect the keys so user should be aware of necessary keys, even more if he remap the keys

@aaronse
Copy link

aaronse commented Jan 4, 2023

  1. After upgrading to latest build and deploying to my SKR the key mapping icons we blank and keys values were unexpected. Sorry, I didn't capture screenshot. I fixed by deleting preferences.js, don't know if this is expected when switching between versions or not? Probably just an artifact of my preferences having older schema for keymap, this shouldn't be problem for other users since they never had keymap settings until now...

  2. Use keyboard moved to unexpected location, was in jogging panel dropdown, now is in panels list drop down. I spent way too long trying to find. I noticed Settings panel has a Key Settings section containing Auto Repeat setting. Consider moving Use Keyboard to settings panel instead. Do you think that will be easier for people to find? Personally, I plan to always use the keyboard shortcuts when possible.

@aaronse
Copy link

aaronse commented Jan 4, 2023

upper or lower should be user choice no need to upper case

User will mess this up if they manually edit Preference.json. They will type accidentally type "X" when they should type "x". They will accidentally type "Shift+x' when they should type "Shift+X". What's the best option to minimize User frustration?

Edit: I guess Users will be OK if they only use the new UI for key shortcut settings.

@luc-github
Copy link
Owner Author

luc-github commented Jan 4, 2023

point 1 - I have checked vs code key binding and indeed it upper case - so I have followed your suggestion
point 2- this is normal - I do not plan to handle any upgrade change in alpha - only for 3.0-> 3.X or it will be never ending
so deleting preferences.json is the thing to be done if testing new alpha version - there is no release in alpha
point 3 - I have put general configuration in panel general and shorcuts entry in macro list / jog panel and jog shortcut in jog panel - currently use a dedicated panel it is not possible if macros / jog - are different list , and will be a challenge to update shortcut list if macro change / added / is deleted , same for others panel if there is shortcut request for each panel - so let says it is feature

Edit : user should not edit manually Preference.json this is not good recommendation to give, I do not plan to deliver a Monkey tested fullproof solution sorry

@aaronse
Copy link

aaronse commented Jan 4, 2023

point 2- this is normal

Good to know. So users upgrading to new release will get the new keymap settings merged into their preferences, they don't need to delete their preferences file as part of the upgrade?

Edit : user should not edit manually Preference.json this is not good recommendation to give, I do not plan to deliver a Monkey tested fullproof solution sorry

LOL, makes sense.

Pulling and trying out latest version. Hope I'm helping more than I'm pestering :-)

@luc-github
Copy link
Owner Author

luc-github commented Jan 4, 2023

1 So users upgrading to new release will get the new keymap settings merged into their preferences, they don't need to delete their preferences file as part of the upgrade?
yes backward compatibility is something important to me as well as breaking changes between version
all 3.X but alpha / beta should be backward compatible with seamless upgrade, from another point of view upgrade from 2.X->3.X is out of scope for backward compatibility

3 - Hope I'm helping more than I'm pestering :-)

I am always open to discuss and listen constructive comments - as you saw after discussing I may also change my mind if I am convinced - and it also good for me to explain my dev choice - challenging them is ok, it make me reviewing my decision - some decision can be technical - architechtural - historical - but also related to the fact I am lazy (orz) or I have limited bandwidth to do everything and they are just decisions based on priorites list

This reverts commit b18cc83.
@luc-github luc-github merged commit 1eab237 into 3.0 Jan 8, 2023
@edrex edrex mentioned this pull request May 2, 2023
Engineer2Designer added a commit to Engineer2Designer/ESP3D-WEBUI that referenced this pull request Jan 17, 2024
commit 71b9b13709cca83683d7b24b736ad96b626c9cbf
Author: E2D <engineer2designer@gmail.com>
Date:   Wed Jan 17 15:53:06 2024 +0800

    chang E2DxESP

commit db95b26
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue May 16 20:33:31 2023 +0800

    Add translation for 'language'

    Add language entries in ESP400/ESP420 for test server
    Fix select string validation error

commit 9e77ed6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Apr 29 10:20:36 2023 +0800

    Update index.js

commit 11c6a52
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 20:12:42 2023 +0800

    Update index.html.gz

commit 445635a
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 20:12:33 2023 +0800

    Fix scroollbar hide drop zone border on file panel

commit 7f1449c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 19:26:12 2023 +0800

    Remove unwished panel class in file list that may generate overflow if lot of files

commit 6310b4b
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 13:40:55 2023 +0800

    Split Terminal Buffer to Verbose Buffer and Quiet Buffer

    Fixes luc-github#355  Build package
    Bump version
    Build package

commit e26ff03
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 12:03:07 2023 +0800

    Add support for swap X Y, Invert X/Y/Z

commit f5247a9
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Apr 11 22:41:18 2023 +0800

    Rebuild packages

commit 5ed515a
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Apr 8 14:01:30 2023 +0800

    Make logo visible even in dark mode

commit d40850f
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Apr 3 10:21:14 2023 +0800

    Fix typo issue with datetime generation in webui orz...

    Bump version

commit 54bb6c8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 2 19:18:25 2023 +0800

    Add support for GCODE starting by C and D

commit eb80ce5
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Apr 1 15:15:01 2023 +0800

    Fix multiple file upload not working

commit ce8c5af
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Mar 11 17:33:35 2023 +0800

    Update .prettierrc

commit 0af2ae9
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Mar 8 04:56:42 2023 +0800

    remove hard coded size of svg as now handled by css

commit 794e082
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Mar 8 04:38:59 2023 +0800

    resize 3dprinter jog svg according resolution

commit 7aa9f02
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 27 09:09:24 2023 +0800

    Add support for Marlin 1.X in settings

    Add Marlin 1.X settings in Marlin emulator

commit 1439b49
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Feb 24 08:49:50 2023 +0800

    Fix test websocket server

commit 20922b4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Feb 22 06:52:54 2023 +0800

    Update README.md

commit defb257
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 20 14:05:56 2023 +0800

    Fix dev server websocket port is incorrect with latest code

    Fix extra panel name not displayed in collapsed view

commit 8e3bafe
Author: René Pasold <rene@pasold.org>
Date:   Wed Feb 15 23:58:53 2023 +0100

    Fix recognition of 100% M73 print status update (multiple leading whitespaces) (luc-github#302)

commit 63bd0b4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 13 10:20:11 2023 +0800

    Send 0xA3 command if state change to `Tool`

    Build packages with latest changes

commit e881e82
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 13 08:58:25 2023 +0800

    Add Resume if State is Tool

    related to luc-github#269

commit e4cd6d6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Feb 9 18:00:02 2023 +0800

    Fix luc-github#300

commit 966c99c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Feb 9 09:21:36 2023 +0800

    Fix wrong title page on disconnection refresh

commit a05ffb0
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Feb 4 11:35:42 2023 +0800

    Fix some values are not properly translated due to format

commit c3260f4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Feb 1 08:13:24 2023 +0800

    Fix websocket error when using nat and change port number

commit f5275d4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Jan 27 20:34:11 2023 +0800

    Fix additionnal error message not displayed for saving data

commit f3e11c4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Jan 18 16:17:27 2023 +0800

    Remove the confusing `404 - Not Found preferences.json` notification if no preferences.json is available

commit 08c14ff
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Jan 18 15:16:18 2023 +0800

    Add missimg translation

commit 6bdd438
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Jan 18 13:10:44 2023 +0800

    Add usb translation support

commit dfcff05
Author: René Pasold <rene@pasold.org>
Date:   Sat Jan 14 23:43:53 2023 +0100

    Add support for various Marlin message types (luc-github#293)

    * Adaptions: theme, support M73 report

    * fan speed report support (M106 ..)

    * print progress float support

commit b4e24e7
Author: aaron GitHub <aaronse@outlook.com>
Date:   Tue Jan 10 04:18:07 2023 -0800

    Fix number input infocus to not invoke keyshortcut.  Fix keyshortcut code to be insensitive.  Current checked in code is not working for arrow keys. (luc-github#291)

    Merged - thank you

commit 1eab237
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Jan 8 09:00:03 2023 +0800

    3.0 keyboard shortcut mapping  (luc-github#288)

    * Implement user type shortcut
    * Move shortcut handler to Dashboard page to handle all panels
    * Upper Case Letters for shortcuts
    Co-authored-by: aaron GitHub <aaronse@outlook.com>

commit ad07df8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Jan 6 10:48:50 2023 +0800

    Add missing case

commit a65550f
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Jan 6 10:43:09 2023 +0800

    Add contextual translation for about status

commit afc13aa
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Dec 28 08:40:20 2022 +0800

    Add more consistency in key mapping for jog X+ / X- Y+ / Y- raised by @V1EngineeringInc

commit 7150011
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Dec 5 13:27:06 2022 +0800

    Add support for ESP3D-TFT for FW Github link

    Bump version

commit 2478f65
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 23 13:32:41 2022 +0800

    Update ESP3D [ESP400] format.md

commit d2795ef
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Oct 11 12:05:28 2022 +0800

    Fix missing conversion from steps to mm in positions (luc-github#275)

    Add ETX command
    Add formatCommand function for HP-GL to ensure commands are properly formated with ending ; when needed

commit 600e682
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Oct 10 18:18:13 2022 +0800

    Rebuild package to integrate luc-github#274

commit b310732
Merge: 04bb509 1dd4445
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Oct 10 18:15:50 2022 +0800

    Merge branch '3.0' of https://github.com/luc-github/ESP3D-WEBUI into 3.0

commit 04bb509
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Oct 10 18:15:47 2022 +0800

    Add Plotter support for jog panel

commit 1dd4445
Author: Pavulon87 <github@pavulon.net>
Date:   Sun Oct 9 16:04:41 2022 +0200

    Fix missing settingid of temperatures panel (luc-github#274)

commit 387f3c9
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:49:41 2022 +0800

    Add PD; PU; PRXXX, YYY; OA: support command in test server

commit 09af4dd
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:48:53 2022 +0800

    Change JogPanel for dedicated one for plotter WIP

commit 028cf8a
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:48:10 2022 +0800

    Remove unused Machine settings

commit 200fa5f
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:38:56 2022 +0800

    Allow any setting to be hidden in webUI - done for HP-GL Machine setting that is not used

commit f93c539
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 12:49:45 2022 +0800

    Code base for HP-GL WIP

commit aaee2c7
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Oct 7 16:14:04 2022 +0800

    Update Commands.md

commit 4e74537
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 27 19:27:34 2022 +0800

    New axis definition (luc-github#270)

    * Add support of ABCUVW axis for grbHAL

    Refactor the JogCNC panel
    Fix prob value was not properly saved

    * Update JogCNC.js

    * Build packages with latest changes

    bump version

commit f9eb97c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 22 13:51:48 2022 +0800

    Add check language script

commit 15e7cc8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 22 10:21:36 2022 +0800

    Update languagepack.md

commit b77bbf6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 22 10:15:04 2022 +0800

    Add basic scripts for language packs management - WIP

commit d085183
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 20 17:04:07 2022 +0800

    Update ESP3D [ESP800] format.md

commit e4febd8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 20 14:46:31 2022 +0800

    Fix crash  due to wrong Mask bits size definition if bit index is over array capability

    Fix mask saving crash = regression due to fix for space
    Fix glitch in index of mask for value test
    Bump version

commit 3f9c7c0
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 20 10:20:34 2022 +0800

    Add support of U and E flag of ESP400 output

    Bump version

commit badadfa
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Sep 19 18:42:45 2022 +0800

    Add File stream streaming detection from ? for grblHAL

commit 2b1c5c6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 20:40:54 2022 +0800

    Add support for XbitMask and bitMask

    Bump version

commit a952eb2
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 13:56:39 2022 +0800

    Remove ugly {" "} and use style when necessary

commit d06c8a2
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 13:32:59 2022 +0800

    Add ESP401 server emulation

    Add support of  float in [ESP400]

commit dbfd47c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 09:38:40 2022 +0800

    apply not saved changes

commit a89c409
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 15 10:56:01 2022 +0200

    Rename directories with proper grblHAL typo

commit e5ff248
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 15 15:37:01 2022 +0800

    Fix grblHAL typo in documents

commit e88b154
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Sep 14 07:40:20 2022 +0800

    Update websocket.md

commit 2e53367
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 12:56:31 2022 +0800

    Create ESP3D [ESP410] format.md

commit 93657b0
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 12:19:27 2022 +0800

    Fix not translated string

commit 29fa38b
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 12:05:31 2022 +0800

    Add grblHal logo for grblhal target

    Use target function to define feature id is SSID to hook the scan button on input box
    Reactivate Feature page for grblHal now ESP400 is enabled
    Bump version

commit f1d818b
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 08:54:32 2022 +0800

    Fix update still display when web update is disabled
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

Successfully merging this pull request may close these issues.

2 participants