shortcuts : add some, offer possibilities to customize them

Request new functionality here
User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 03 Jun 2008, 23:02

Thanks! I aim to please. :D

I think that enabling category selection with j/k should be relatively easy, I'll take a look when I have some time to kill.

Christophe-Marie
Bear Rating Trainee
Bear Rating Trainee
Posts: 22
Joined: 09 May 2008, 21:01
Location: France
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby Christophe-Marie » 04 Jun 2008, 00:49

You rox :)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 04 Jun 2008, 22:00

OK, category selection with j/k is in trunk. If anyone wants to test this patchset, it would be great.

Christophe-Marie
Bear Rating Trainee
Bear Rating Trainee
Posts: 22
Joined: 09 May 2008, 21:01
Location: France
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby Christophe-Marie » 05 Jun 2008, 12:52

I just patched tt-rss.js and functions.js with your code, and it is working just fine. Great!

Some constructive comment : I was not able to distinguish where I was in the categories. Maybe some graphical effects that emphasizes the selected category would help? Besides, I've seen it is the same thing for a feed that has errors ("red" feeds). I think it would probably make things easier if one could always distinguish the selected feed (category, or real feed) from the others.

Apart from that, I was wondering how this was implemented : what I understand when I use this (and when I try to read the code, but it was the very first time I was reading js, I've never tried web programming before), is that there is a request performed on the next feed (up or down) at *every* keystroke. So, for example : if you want to go two feeds down (by pressing k twice), you'll have to press k, wait for the first feed to be got (useless waiting time - you want the one downside), then press k another time to go to the second.

Do you think there is a way to avoid that? Like with a timer : if you stay long enough on the selected feed, it will perform the "get". But if you press j/k a second time, nothing will be done. That would avoid a useless request (and waiting time).

I don't know if you understand what I'm saying, maybe it is unclear. Let me know if I am totally wrong, or if you think what I say does not make any sense :)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 05 Jun 2008, 16:49

I was not able to distinguish where I was in the categories.


Try this patchset. That won't fix the red feeds - there is an impelementaton detail, which makes fixing those quite cumbersome.

I know about the repeated hotkeys thing, it needs some global fix (headlines behave the same way, etc). I'm not sure how to do it right at the moment, though. Patches are welcome. :D

kgrossjo
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 08 Sep 2008, 11:04

Re: shortcuts : add some, offer possibilities to customize them

Postby kgrossjo » 08 Sep 2008, 11:07

There should be a way to scroll the article, too.

I think j/k are backwards. Vim users expect j to go down, k to go up.

IMVHO, it might be beneficial to rearrange the shortcuts. In vim, j/k are so conveniently placed because they are used so often. I think "wasting" these on the relatively rare action to move to another feed does not make sense. In fact, I expect j/k to scroll the article (as in less). Then n/p could navigate between articles, as they do now. And perhaps N/P could be used to navigate between feeds?

What do people think?

Kai

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 08 Sep 2008, 12:47

I think j/k are backwards. Vim users expect j to go down, k to go up.

I'm very happy for vim users. Incidentally, tt-rss is not vim.

Anyway... Those shortcuts were there for a while, suddenly reversing their meaning like that could be annoying. It might have been a good idea change stuff like that with the global hotkey overhaul detailed above, but now it's kinda too late.

N/P are already used. Its function is (in my opinion) quite rare so I could go to replace them with c N/c P and do set N/P as article scrolling hotkeys.

Christophe-Marie
Bear Rating Trainee
Bear Rating Trainee
Posts: 22
Joined: 09 May 2008, 21:01
Location: France
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby Christophe-Marie » 08 Sep 2008, 16:29

kgrossjo wrote:There should be a way to scroll the article, too.

I think j/k are backwards. Vim users expect j to go down, k to go up.

IMVHO, it might be beneficial to rearrange the shortcuts. In vim, j/k are so conveniently placed because they are used so often. I think "wasting" these on the relatively rare action to move to another feed does not make sense. In fact, I expect j/k to scroll the article (as in less). Then n/p could navigate between articles, as they do now. And perhaps N/P could be used to navigate between feeds?

What do people think?

Kai

True. But Fox is right, inverting thos shortcuts could be frustrating for longtime users.

My advice : modify the javascript, it's the easiest way to get what you want without annoying people (that's what I do)...

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 09 Sep 2008, 14:50

Image

Christophe-Marie
Bear Rating Trainee
Bear Rating Trainee
Posts: 22
Joined: 09 May 2008, 21:01
Location: France
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby Christophe-Marie » 10 Sep 2008, 12:02

Great!

User avatar
jcordasc
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 19 Nov 2008, 22:33

Re: shortcuts : add some, offer possibilities to customize them

Postby jcordasc » 20 Nov 2008, 03:47

If it doesn't upset anyone, I have a small patch (for version 1.2.28) that I'd like to leave in the forums for anyone who wants to make the keyboard shortcuts more like Google Reader. While it certainly isn't rocket science, I thought someone searching the forums might like to have a simple patch to apply.

Applying it is straight forward:
$ cd /path/to/tt-rss/
$ patch -p0 < googkeys.patch

I was also considering poking the tt-rss code a bit and seeing if I could easily add a feature where the next/prev category/feed showed an indicator without causing the selected item to load, and a keyboard shortcut similar to GReader's Shift+O would then open the selected feed/category. This would allow you to move around the feed list a bit quicker from the keyboard. Would anyone else be interested in such a patch?

-J

PS - I couldn't upload the patch file either as a .patch or .txt so I'm including it inline. (This will likely cause a problem with tabs and all. Any suggestions for uploading it?)

Code: Select all

--- tt-rss.js.orig   2008-11-19 16:09:38.000000000 -0600
+++ tt-rss.js  2008-11-19 16:13:19.000000000 -0600
@@ -1102,7 +1102,7 @@
            }
         }
 
-        if (keycode == 74) { // j
+        if (keycode == 75 && shift_key) { // K
            var feed = getActiveFeedId();
            var new_feed = getRelativeFeedId2(feed, activeFeedIsCat(), 'prev');
 //            alert(feed + " IC: " + activeFeedIsCat() + " => " + new_feed);
@@ -1118,7 +1118,7 @@
            return;
         }
   
-        if (keycode == 75) { // k
+        if (keycode == 74 && shift_key) { // J
            var feed = getActiveFeedId();
            var new_feed = getRelativeFeedId2(feed, activeFeedIsCat(), 'next');
 //            alert(feed + " IC: " + activeFeedIsCat() + " => " + new_feed);
@@ -1144,25 +1144,25 @@
            return;
         }
 
-        if (shift_key && keycode == 78) { // N
+        if (keycode == 40) { // N
            scrollArticle(50);   
            return;
         }
 
-        if (shift_key && keycode == 80) { // P
+        if (keycode == 38) { // P
            scrollArticle(-50); 
            return;
         }
 
 
-        if (keycode == 78 || keycode == 40) { // n, down
+        if (keycode == 78 || keycode == 74) { // n, j
            if (typeof moveToPost != 'undefined') {
               moveToPost('next');
               return;
            }
         }
   
-        if (keycode == 80 || keycode == 38) { // p, up
+        if (keycode == 80 || keycode == 75) { // p, k
            if (typeof moveToPost != 'undefined') {
               moveToPost('prev');
               return;
@@ -1186,7 +1186,7 @@
         }
 
 
-        if (keycode == 85) { // u
+        if (keycode == 77) { // m
            var id = getActiveArticleId();
            if (id) {           
               toggleUnread(id);
@@ -1215,7 +1215,7 @@
            }
         }
 
-        if (keycode == 79) { // o
+        if (keycode == 86) { // v
            if (getActiveArticleId()) {
               openArticleInNewWindow(getActiveArticleId());
               return;
--- help/3.php.orig  2008-11-19 16:28:10.000000000 -0600
+++ help/3.php 2008-11-19 16:29:19.000000000 -0600
@@ -5,8 +5,8 @@
   <h2><?php echo __("Navigation") ?></h2>
 
   <table>
-     <tr><td class='n'>j/k</td><td><?php echo __("Move between feeds") ?></td></tr>
-     <tr><td class='n'>n/p</td><td><?php echo __("Move between articles") ?></td></tr>
+     <tr><td class='n'>J/K</td><td><?php echo __("Move between feeds") ?></td></tr>
+     <tr><td class='n'>j/k or n/p</td><td><?php echo __("Move between articles") ?></td></tr>
      <tr><td class='n'>/</td><td><?php echo __("Show search dialog") ?></td></tr>
   </table>
 
@@ -15,11 +15,11 @@
   <table>
      <tr><td class='n'>s</td><td><?php echo __("Toggle starred") ?></td></tr>
      <tr><td class='n'>S</td><td><?php echo __("Toggle published") ?></td></tr>
-     <tr><td class='n'>u</td><td><?php echo __("Toggle unread") ?></td></tr>
+     <tr><td class='n'>m</td><td><?php echo __("Toggle unread") ?></td></tr>
      <tr><td class='n'>T</td><td><?php echo __("Edit tags") ?></td></tr>
-     <tr><td class='n'>o</td><td><?php echo __("Open article in new window") ?></td></tr>
+     <tr><td class='n'>v</td><td><?php echo __("Open article in new window") ?></td></tr>
      <tr><td class='n'>c n/c p</td><td><?php echo __("Mark articles below/above active one as read") ?></td></tr>
-     <tr><td class='n'>N/P</td><td><?php echo __("Scroll article content") ?></td></tr>
+     <tr><td class='n'>up/down</td><td><?php echo __("Scroll article content") ?></td></tr>
 
   </table>


User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 20 Nov 2008, 09:42

Just pastebin it and post the link here, I'll place it somewhere more permanent.

User avatar
jcordasc
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 19 Nov 2008, 22:33

Re: shortcuts : add some, offer possibilities to customize them

Postby jcordasc » 20 Nov 2008, 23:44

Ok. I've put it up at: http://pastebin.com/m1697b5d

The '@@' at the front of the divider lines in the unified diff turn on highlighting on the page, but seem intact in the downloadable version.

Also, in an attempt for a quick workaround for the feed/category keyboard navigation that I mentioned above, I was trying to use Firefox's search feature. This works well for feeds: typing "'slash" (single quote followed by s-l-a-s-h) finds my Slashdot feed. Pressing enter then "opens" the link ... i.e. loads that feed in the main headline area.

Unfortunately, the category names are marked up as span's without inner anchor tags. While '/' searches text in general, there is no way to "click" on text that is not a link from the keyboard. Therefore, I was wondering if you'd mind a change to the markup for categories, making them links as well. If so, I'd be happy to hack it together as I get some time. (Unless of course you have the time. :) )

-J

PS - Feel free to tell me when I've become a pain in the backside. I'm just so happy to find such a wonderful alternative to the google services juggernaut. I know I can over do it, so don't hesitate to tell me to shut up.

MattKatz
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 29 Oct 2008, 02:16

Re: shortcuts : add some, offer possibilities to customize them

Postby MattKatz » 21 Nov 2008, 01:10

I really like the idea of making the shortcuts more similar. i'll probably try pushing these into my installation.

Thanks jcordasc!

(and thanks fox for the whole thing - tt-rss is leagues ahead of the other web feed readers.)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: shortcuts : add some, offer possibilities to customize them

Postby fox » 21 Nov 2008, 11:22

jcordasc wrote:Ok. I've put it up at: http://pastebin.com/m1697b5d

The '@@' at the front of the divider lines in the unified diff turn on highlighting on the page, but seem intact in the downloadable version.


Saved for posterity here: http://tt-rss.org/stuff/ttrss-greader-like-hotkeys.diff

Unfortunately, the category names are marked up as span's without inner anchor tags. While '/' searches text in general, there is no way to "click" on text that is not a link from the keyboard. Therefore, I was wondering if you'd mind a change to the markup for categories, making them links as well. If so, I'd be happy to hack it together as I get some time. (Unless of course you have the time. :) )


I remember removing links for some reason several versions ago, but don't really remember why. I think it was some kind of weird Opera-related issue (clicks falling through js handler and breaking UI or something). It could've been something else, though.

PS - Feel free to tell me when I've become a pain in the backside. I'm just so happy to find such a wonderful alternative to the google services juggernaut. I know I can over do it, so don't hesitate to tell me to shut up.


Heh. I don't see any reason to do that. It's not like this (mostly dead) forum takes a lot of my time. :D


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 4 guests