init.php 795 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. class GoogleReaderKeys extends Plugin {
  3. private $link;
  4. private $host;
  5. function about() {
  6. return array(1.0,
  7. "Keyboard hotkeys emulate Google Reader",
  8. "markwaters");
  9. }
  10. function init($host) {
  11. $this->link = $host->get_link();
  12. $this->host = $host;
  13. $host->add_hook($host::HOOK_HOTKEY_MAP, $this);
  14. }
  15. function hook_hotkey_map($hotkeys) {
  16. $hotkeys["j"] = "next_article_noscroll";
  17. $hotkeys["k"] = "prev_article_noscroll";
  18. $hotkeys["*n"] = "next_feed";
  19. $hotkeys["*p"] = "prev_feed";
  20. $hotkeys["v"] = "open_in_new_window";
  21. $hotkeys["r"] = "feed_refresh";
  22. $hotkeys["m"] = "toggle_unread";
  23. $hotkeys["(32)|space"] = "next_article";
  24. $hotkeys["(38)|up"] = "article_scroll_up";
  25. $hotkeys["(40)|down"] = "article_scroll_down";
  26. return $hotkeys;
  27. }
  28. }
  29. ?>