Skip to content

Instantly share code, notes, and snippets.

@WishCow WishCow/init.php

Last active Dec 15, 2015
Embed
What would you like to do?
Custom keyboard shortcuts for TinyTinyRSS
<?php
class MyKeys extends Plugin {
private $link;
private $host;
function about() {
return array(1.0,
"My custom keybindings",
"WishCow");
}
function init($host) {
$this->link = $host->get_link();
$this->host = $host;
$host->add_hook($host::HOOK_HOTKEY_MAP, $this);
}
/**
* You can find the full list of shortcut names in includes/functions.php:1856,
* get_hotkeys_info
*/
function hook_hotkey_map($hotkeys) {
$myKeys = array(
"j" => "next_article",
"k" => "prev_article",
"l" => "next_feed",
"h" => "prev_feed",
"/" => "search_dialog",
"q" => "close_article",
"m" => "feed_catchup",
"M" => "catchup_all",
"u" => "toggle_unread",
"c t" => "edit_tags",
"o" => "open_in_new_window",
"J" => "article_scroll_down",
"K" => "article_scroll_up",
"w" => "toggle_widescreen",
"f" => "feed_subscribe",
"W" => "toggle_combined_mode",
"g a" => "goto_all",
"g f" => "goto_fresh",
":" => "goto_prefs",
"c l" => "create_label",
"c f" => "create_filter",
"s" => "collapse_sidebar",
"r" => "feed_reverse"
);
return array_merge($hotkeys, $myKeys);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.