Re: Module-wise Keyboard preferences

From: Harshal Dhumal <harshal(dot)dhumal(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Module-wise Keyboard preferences
Date: 2018-01-19 09:29:29
Message-ID: CAFiP3vxEoM=wKZWouiZSPO6NFi7ZtZc7x=Texd6MHztxVUsOgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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]
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

[my locale settings]
[image: Inline image 3]

>
> On Wed, Jan 17, 2018 at 6:34 AM, Harshal Dhumal <
> harshal(dot)dhumal(at)enterprisedb(dot)com> wrote:
>
>> Hi Team,
>>
>> I'm attaching initial patch for feature module-wise keyboard preference.
>>
>> Also apart from main patch I have also attached one sample debugger
>> keyboard shortcut patch to illustrate how to add module-wise preferences
>>
>> [image: Inline image 1]
>>
>>
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Companypg
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

Attachment Content-Type Size
keyboard_pref_RM2984_V1.patch text/x-patch 11.9 KB
keyboard_pref_debugger_example_V1.patch text/x-patch 2.4 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Joao De Almeida Pereira 2018-01-19 12:56:32 Re: [pgadmin4][Patch]: Display Functions node for GreenPlum database
Previous Message Khushboo Vashi 2018-01-19 06:02:56 Re: "Fetching all records..."