-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.php
More file actions
41 lines (33 loc) · 1.04 KB
/
init.php
File metadata and controls
41 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*
* Add this file to a directory named `mykeys` in the plugin directory. Reload
* TT-RSS and enable the plugin via Preferences→Plugins.
*/
class MyKeys extends Plugin {
private $host;
function about() {
return [
1.1,
'Personal keyboard configuration',
'dandersson',
false];
}
function api_version() {
return 2;
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_HOTKEY_MAP, $this);
}
function hook_hotkey_map($hotkeys) {
$hotkeys['(13)|enter'] = 'open_in_new_window';
$hotkeys['*(13)|s-enter'] = 'open_in_background_tab';
$hotkeys['(37)|left'] = 'prev_article_noscroll';
$hotkeys['(38)|up'] = 'article_scroll_up';
$hotkeys['(39)|right'] = 'next_article_noscroll';
$hotkeys['(40)|down'] = 'article_scroll_down';
$hotkeys['*(38)|s-up'] = 'prev_feed';
$hotkeys['*(40)|s-down'] = 'next_feed';
return $hotkeys;
}
}