[PR #1490] [MERGED] fix #1459 Refactor pressed key checking #3534

Closed
opened 2026-02-27 00:57:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/electerm/electerm/pull/1490
Author: @damosse31
Created: 1/1/2020
Status: Merged
Merged: 1/1/2020
Merged by: @zxdong262

Base: masterHead: fix-pressed-key


📝 Commits (1)

📊 Changes

6 files changed (+52 additions, -20 deletions)

View changed files

src/client/common/key-pressed.js (+7 -0)
src/client/common/key-shift-pressed.js (+7 -0)
📝 src/client/components/session/index.jsx (+2 -1)
📝 src/client/components/sftp/index.jsx (+10 -9)
📝 src/client/components/terminal/index.jsx (+24 -9)
📝 src/client/store/index.js (+2 -1)

📄 Description

Add method to check if shift key is pressed --> src/client/common/key-shift-pressed.js
Add method to check if given key is checked --> src/client/common/key-pressed.js

Use .key event property instead of .code to avoid differences in keyboard disposition (eg QWERTY vs AZERTY)

Example, the letter W (code = KeyW) on my AZERTY keyboard is letter Z (code KeyZ) on your QWERTY keyboard, and shortcut fail in this case.

Now we check the real character pressed as explained here : https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code

Also it fix issue #1459 for CTRL + SHIFT + C shortcut to copy selected text in terminal (tested on my side in Linux Mint 19 and Ubuntu 18.04)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/electerm/electerm/pull/1490 **Author:** [@damosse31](https://github.com/damosse31) **Created:** 1/1/2020 **Status:** ✅ Merged **Merged:** 1/1/2020 **Merged by:** [@zxdong262](https://github.com/zxdong262) **Base:** `master` ← **Head:** `fix-pressed-key` --- ### 📝 Commits (1) - [`96a0e41`](https://github.com/electerm/electerm/commit/96a0e415423fee4109a6fd5a4d46a7194835362b) refactor pressed key checking + fix issue #1459 ### 📊 Changes **6 files changed** (+52 additions, -20 deletions) <details> <summary>View changed files</summary> ➕ `src/client/common/key-pressed.js` (+7 -0) ➕ `src/client/common/key-shift-pressed.js` (+7 -0) 📝 `src/client/components/session/index.jsx` (+2 -1) 📝 `src/client/components/sftp/index.jsx` (+10 -9) 📝 `src/client/components/terminal/index.jsx` (+24 -9) 📝 `src/client/store/index.js` (+2 -1) </details> ### 📄 Description Add method to check if shift key is pressed --> src/client/common/key-shift-pressed.js Add method to check if given key is checked --> src/client/common/key-pressed.js Use **.key** event property instead of **.code** to avoid differences in keyboard disposition (eg QWERTY vs AZERTY) Example, the letter W (code = **KeyW**) on my AZERTY keyboard is letter Z (code **KeyZ**) on your QWERTY keyboard, and shortcut fail in this case. Now we check the real character pressed as explained here : https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code Also it fix issue #1459 for CTRL + SHIFT + C shortcut to copy selected text in terminal (tested on my side in Linux Mint 19 and Ubuntu 18.04) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 00:57:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/electerm#3534
No description provided.