Re: Module-wise Keyboard preferences

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Harshal Dhumal <harshaldhumal15(at)gmail(dot)com>
Cc: Harshal Dhumal <harshal(dot)dhumal(at)enterprisedb(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Module-wise Keyboard preferences
Date: 2018-01-23 11:22:36
Message-ID: CA+OCxow7Mt3yhbhw6O2AKC0RLrgV6Qri-+87ddaVhfABaLD+Ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Tue, Jan 23, 2018 at 6:31 AM, Harshal Dhumal <harshaldhumal15(at)gmail(dot)com>
wrote:

> Hi Dave,
>
> On Mon, Jan 22, 2018 at 5:26 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>
>> Hi
>>
>> On Fri, Jan 19, 2018 at 9:29 AM, Harshal Dhumal <
>> harshal(dot)dhumal(at)enterprisedb(dot)com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Wed, Jan 17, 2018 at 4:58 PM, Dave Page <dpage(at)pgadmin(dot)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.
>>>
>>> [image: 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 À <http://www.codetable.net/decimal/192>
>>>
>>> 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
>>
> My patch is related to add infrastructure for keyboard shortcut
> preferences and not to add any particular preference.
> We can add docs for actual keyboard preference when we start adding
> keyboard preferences.
>
> I share two patches out of one is example (keyboard shortcut preferences
> for debugger) and not a final patch.
> It's purpose is provide example (for developers only) about how to add
> keyboard preferences.
>
> Please let me know which doc updates are you expecting?
>

Good point - I missed that it's only the infrastructure part that's ready
to go.

My other comments stand; there's got to be a nicer way to present the UI,
and I'd like to see the JS broken up into smaller chunks, with tests, if
feasible.

Thanks.

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

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

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message pgAdmin 4 Jenkins 2018-01-23 11:42:55 Build failed in Jenkins: pgadmin4-master-python35 #455
Previous Message microsys.gr microsys.gr 2018-01-23 11:14:05 Fwd: "Fetching all records..."