init.php 743 B

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