From 89eb03aff0b50b00555aee1a886e4cb4106229e7 Mon Sep 17 00:00:00 2001 From: cpradio Date: Fri, 29 Aug 2014 22:18:03 -0400 Subject: [PATCH 1/3] FIX: Support J/K bindings on German Keyboards J/K are not supported on German keyboards, shift+j and shift+k have been added to remedy this. https://meta.discourse.org/t/keyboard-shortcuts-for-next-previous-section-do-not-work-with-german-keyboard-layout/18902 --- app/assets/javascripts/discourse/lib/keyboard_shortcuts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index 619b81300f3..3f44bf72d69 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -47,7 +47,9 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ 'home': 'goToFirstPost', '#': 'toggleProgress', 'end': 'goToLastPost', + 'shift+j': 'selectDown', 'j': 'selectDown', + 'shift+k': 'selectUp', 'k': 'selectUp', 'u': 'goBack', '`': 'nextSection', From 3f5d5305532272383f298db1b674ff23fa2ac8e1 Mon Sep 17 00:00:00 2001 From: cpradio Date: Sat, 30 Aug 2014 07:31:38 -0400 Subject: [PATCH 2/3] Change SHIFT+J and SHIFT+K to move up/down sections instead of posts. --- app/assets/javascripts/discourse/lib/keyboard_shortcuts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index 3f44bf72d69..842148f7030 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -47,9 +47,9 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ 'home': 'goToFirstPost', '#': 'toggleProgress', 'end': 'goToLastPost', - 'shift+j': 'selectDown', + 'shift+j': 'nextSection', 'j': 'selectDown', - 'shift+k': 'selectUp', + 'shift+k': 'prevSection', 'k': 'selectUp', 'u': 'goBack', '`': 'nextSection', From 62342842431216e748aae4538c106fc6a8a0572f Mon Sep 17 00:00:00 2001 From: cpradio Date: Sun, 31 Aug 2014 21:42:03 -0400 Subject: [PATCH 3/3] FIX: Remove the old keyboard bindings for next/prev section, update client.en.yml to reflect the new bindings --- app/assets/javascripts/discourse/lib/keyboard_shortcuts.js | 2 -- config/locales/client.en.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index 842148f7030..3de6d92a5e6 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -52,8 +52,6 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ 'shift+k': 'prevSection', 'k': 'selectUp', 'u': 'goBack', - '`': 'nextSection', - '~': 'prevSection', '/': 'showSearch', '=': 'showSiteMap', // open site map menu 'p': 'showCurrentUser', // open current user menu diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 8585a68ceb9..bef50976ad2 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2049,7 +2049,7 @@ en: back: 'u Back' up_down: 'k/j Move selection up/down' open: 'o or Enter Open selected topic' - next_prev: '`/~ Next/previous section' + next_prev: 'shift j/shift k Next/previous section' application: title: 'Application' create: 'c Create a new topic'