aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--karma.conf.js2
-rw-r--r--src/shared/utils/keys.js3
-rw-r--r--test/shared/utils/keys.test.js20
4 files changed, 26 insertions, 3 deletions
diff --git a/README.md b/README.md
index 8ed8deb..c9b8490 100644
--- a/README.md
+++ b/README.md
@@ -44,8 +44,8 @@ See [console commands](#console-commands) section for more detailed description
#### Scrolling
-- <kbd>k</kbd>: scroll down
-- <kbd>j</kbd>: scroll up
+- <kbd>k</kbd>: scroll up
+- <kbd>j</kbd>: scroll down
- <kbd>h</kbd>: scroll left
- <kbd>l</kbd>: scroll right
- <kbd>Ctrl</kbd>+<kbd>U</kbd>: scroll up for a half page
diff --git a/karma.conf.js b/karma.conf.js
index 7331331..5e69f9e 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -24,7 +24,7 @@ module.exports = function (config) {
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
- browsers: ['Firefox'],
+ browsers: ['FirefoxHeadless'],
singleRun: true,
diff --git a/src/shared/utils/keys.js b/src/shared/utils/keys.js
index 4579fde..f024069 100644
--- a/src/shared/utils/keys.js
+++ b/src/shared/utils/keys.js
@@ -1,4 +1,7 @@
const modifiedKeyName = (name) => {
+ if (name === ' ') {
+ return 'Space';
+ }
if (name.length === 1) {
return name;
} else if (name === 'Escape') {
diff --git a/test/shared/utils/keys.test.js b/test/shared/utils/keys.test.js
index 770b530..b2ad3cb 100644
--- a/test/shared/utils/keys.test.js
+++ b/test/shared/utils/keys.test.js
@@ -35,6 +35,17 @@ describe("keys util", () => {
expect(k.altKey).to.be.false;
expect(k.metaKey).to.be.false;
});
+
+ it('returns from keyboard input Crtl+Space', () => {
+ let k = keys.fromKeyboardEvent({
+ key: ' ', shiftKey: false, ctrlKey: true, altKey: false, metaKey: false
+ });
+ expect(k.key).to.equal('Space');
+ expect(k.shiftKey).to.be.false;
+ expect(k.ctrlKey).to.be.true;
+ expect(k.altKey).to.be.false;
+ expect(k.metaKey).to.be.false;
+ });
});
describe('fromMapKey', () => {
@@ -100,6 +111,15 @@ describe("keys util", () => {
expect(key.altKey).to.be.false;
expect(key.metaKey).to.be.false;
});
+
+ it('returns for Ctrl+Esc', () => {
+ let key = keys.fromMapKey('<C-Space>');
+ expect(key.key).to.equal('Space');
+ expect(key.shiftKey).to.be.false;
+ expect(key.ctrlKey).to.be.true;
+ expect(key.altKey).to.be.false;
+ expect(key.metaKey).to.be.false;
+ });
});
describe('fromMapKeys', () => {