mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-11 01:30:29 +03:00
Fix shortcuts on non QWERTY keyboards (#715)
* Use key instead of keyCode or code * Use key for Escape
This commit is contained in:
parent
1d90f7588b
commit
5e527e434a
4 changed files with 10 additions and 12 deletions
|
|
@ -31,14 +31,14 @@ function listenKeyboard(event) {
|
|||
// Ctrl/Cmd +
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
// open search modal
|
||||
if (event.code === 'KeyK') {
|
||||
if (event.key === 'k') {
|
||||
event.preventDefault();
|
||||
if (navigation.isRawModalVisible) return;
|
||||
openSearch();
|
||||
}
|
||||
|
||||
// focus message field on paste
|
||||
if (event.code === 'KeyV') {
|
||||
if (event.key === 'v') {
|
||||
if (navigation.isRawModalVisible) return;
|
||||
const msgTextarea = document.getElementById('message-textarea');
|
||||
const { activeElement } = document;
|
||||
|
|
@ -52,7 +52,7 @@ function listenKeyboard(event) {
|
|||
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||
if (navigation.isRawModalVisible) return;
|
||||
|
||||
if (event.code === 'Escape') {
|
||||
if (event.key === 'Escape') {
|
||||
if (navigation.isRoomSettings) {
|
||||
toggleRoomSettings();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue