keyboard UI: Add Ctrl + k hotkey.

Fixes #8216
This commit binds the Ctrl + k to go to the search bar.
This commit is contained in:
Aastha Gupta
2018-02-16 21:04:19 +05:30
committed by Tim Abbott
parent 63fe39e381
commit 19806a0283
4 changed files with 5 additions and 3 deletions

View File

@@ -94,6 +94,7 @@ function stubbing(func_name_to_stub, test_function) {
assert.equal(map_press(106).name, 'vim_down'); // j
assert.equal(map_down(219, false, true).name, 'escape');
assert.equal(map_down(75, false, true).name, 'search');
// More negative tests.
assert.equal(map_down(47), undefined);

View File

@@ -48,6 +48,7 @@ var keydown_unshift_mappings = {
};
var keydown_ctrl_mappings = {
75: {name: 'search', message_view_only: false}, // 'K'
219: {name: 'escape', message_view_only: false}, // '['
};

View File

@@ -49,7 +49,7 @@
<td class="definition">{% trans %}All private messages{% endtrans %}</td>
</tr>
<tr>
<td class="hotkey">/</td>
<td class="hotkey">Ctrl + k, /</td>
<td class="definition">{% trans %}Initiate a search{% endtrans %}</td>
</tr>
<tr>
@@ -69,7 +69,7 @@
</tr>
</thead>
<tr>
<td class="hotkey">/</td>
<td class="hotkey">Ctrl + k, /</td>
<td class="definition">{% trans %}Initiate a search{% endtrans %}</td>
</tr>
<tr>

View File

@@ -45,7 +45,7 @@ below, and add more to your repertoire as needed.
## Navigation
* **Search messages**: `/`
* **Search messages**: `/` or `Ctrl+k`
* **Search streams**: `q`