[pgAdmin4][Patch]: RM#1478 - Make code mirror text editor keyboard shortcuts consistent irrespective of platform type

From: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [pgAdmin4][Patch]: RM#1478 - Make code mirror text editor keyboard shortcuts consistent irrespective of platform type
Date: 2016-08-05 17:42:40
Message-ID: CAM5-9D8ExeecjY6Mk7iZ_ZFs+iyLr1-6QtJR0djYvSO_65NtEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

I found that *Code-mirror* library itself provides the List of keyboard
shortcuts for Mac OSX and other platform type.
We just need to pass them in extraKeys param while creating code-mirror
instance.

*Following is the keyboard shortcuts for various operations in text editor:*

1. Copy - [Ctrl-C, Cmd-C]
2. Cut - [Ctrl-X, Cmd-X]
3. Select All - [Ctrl-A, Cmd-A]
4. Undo - [Ctrl-Z, Cmd-Z]
5. Redo - [Ctrl-Y, Cmd-Y]
6. Delete Line - [Ctrl-D, Cmd-D]
7. Move left/right(words) - [Alt-Left, Alt-Right]
8. Move start/end of line - [Cmd-Left, Cmd-Right] // *Ctrl-Left/Right*
are bound to System shortcuts. so these keys cannot be used.

These keyboard shortcuts are consistent in Web/Runtime applications in all
platform types.

*Issue not fixed:*
keyboard shortcut for *Paste text* doesn't work in Mac Runtime only. It is
working on Linux runtime & Windows Runtime.
An issue "Key shortcuts doesn't work on Mac OS for QWebView widget
<https://bugreports.qt.io/browse/QTBUG-46330?jql=project%20%3D%20QTBUG%20AND%20resolution%20%3D%20Unresolved%20AND%20assignee%20%3D%20allan.jensen%20ORDER%20BY%20priority%20DESC>"
is also reported.

I also found that right click paste is working in Mac Runtime which is the
feature of code-mirror, So I am looking into its code to figure out and I
will send a patch with fix once it gets fixed.

Please find attached patch and review.

Thanks,
Surinder Kumar

Attachment Content-Type Size
RM1478_v1.patch application/octet-stream 2.9 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2016-08-05 18:48:11 [pgAdmin4][Patch]: RM1524 - Reverse engineered SQL for Trigger Functions missing "AS"
Previous Message Harshal Dhumal 2016-08-05 15:25:03 patch for RM1177 [pgadmin4]