Re: Module-wise Keyboard preferences - Mailing list pgadmin-hackers

From Dave Page
Subject Re: Module-wise Keyboard preferences
Date
Msg-id CA+OCxozHPxK0vAAHf6Qk9F-nr83eGop4ty6G0NVDziY5mSTB-g@mail.gmail.com
Whole thread Raw
In response to Re: Module-wise Keyboard preferences  (Harshal Dhumal <harshal.dhumal@enterprisedb.com>)
Responses Re: Module-wise Keyboard preferences
List pgadmin-hackers
Hi

On Fri, Jan 19, 2018 at 9:29 AM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi Dave,

On Wed, Jan 17, 2018 at 4:58 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

To summarise an offline discussion we just had, the intention is to replace the switches with checkboxes for Shift, Control, and Alt/Option, then to try to come up with a set of default shortcuts that work on the major platforms/browsers. Investigation into Javascript's handling of keycodes vs. strings is ongoing to figure out the best way to capture and display the selected keys for non-ASCII locales (String.fromCharCode()).

I have replaced switches with checkboxes and also showing all controls for one preference in single line.

Inline image 2

I'm still not happy with the way that looks. Wrapping "Alt/Option" looks horrible - plus it also looks a little odd that labels are closer to the preceding controls than to the following controls to which they actually apply.
 
Regarding String.fromCharCode() to reverse map keycode to char (actual char on keyboard) does not work for all keyboard keys.

For eg. on mac with standard keyboard and with my locale settings I got below behaviour.
For key tilde (~) I got keycode 192 (Unicode value of the pressed keyboard key as per docs) and
when I tried to map 192 (String.fromCharCode(192)) to get actual char, I got À

So instead of mapping keycode to char for display purposse I'm using char which is returned by event object 

OK, sounds fine.

Regarding the patch:

- It's missing doc updates
- There's a huge chunk of JS in there. Can that be split up into smaller chunks and unit tests created for them?

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment

pgadmin-hackers by date:

Previous
From: pgAdmin 4 Jenkins
Date:
Subject: Jenkins build is back to normal : pgadmin4-master-python27 #453
Next
From: pgAdmin 4 Jenkins
Date:
Subject: Jenkins build is back to normal : pgadmin4-master-python35 #453