AutoHotkey Community

It is currently May 27th, 2012, 9:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: November 1st, 2006, 9:58 pm 
On Linix it is very natural to scroll the terminal from the keyboard in case of a long output. Of course, it can also be done with the mouse, but it is not convenient, since when using the command prompt your hands are already on the keyboard.

That's why I made this small script which scrolls the command prompt window with shift+pgup/down. Aside from a little flashing by the system menu, it works perfectly:

Code:
#IfWinActive, ahk_class ConsoleWindowClass
+pgup::send, {alt down}{space}{alt up}el{pgup}{esc}
+pgdn::send, {alt down}{space}{alt up}el{pgdn}{esc}
#IfWinActive


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2006, 10:04 pm 
I used shift+pgup/down, because that's the default on Linux. Simple pgup/down could also be used here, since their default binding in the command prompt seems pretty useless to me.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2006, 10:36 pm 
Yes, I wrote this. Pretty nifty, eh? I forget posting though. :twisted:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2006, 11:05 pm 
Seems like some different Guests here. The drawback of posting anonymously...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2006, 11:19 pm 
Offline
User avatar

Joined: December 20th, 2004, 12:19 pm
Posts: 798
Location: LooseChange911.com Ask Questions, Demand Answers █ The WTC bldgs █ shouldn't have fallen █ that fast
Code:
;//Uncomment one at a time...(can't use if in this case)...

#IfWinActive, ahk_class ConsoleWindowClass
;//scroll=smooth
+pgup::Send, {WheelUp}
+pgdn::Send, {WheelDown}

;//scroll=page
;+pgup::Click, WheelUp
;+pgdn::Click, WheelDown

;//scroll=weird
;+pgup::WheelUp
;+pgdn::WheelDown

;//scroll=menu
;+pgup::send, {alt down}{space}{alt up}el{pgup}{esc}
;+pgdn::send, {alt down}{space}{alt up}el{pgdn}{esc}
#IfWinActive

Anonymous wrote:
...since their default binding in the command prompt seems pretty useless to me.

...their default action is moving to the top or bottom of the command history...I always use page down to re-run the last command...or at least insert the last command into the line so I can edit it & re-send it...default page up/down in command prompt is useful...

_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 12:28 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 775
Location: Texas, USA
JSLover wrote:
Code:
#IfWinActive, ahk_class ConsoleWindowClass
;//scroll=page
+pgup::Click, WheelUp
+pgdn::Click, WheelDown
#IfWinActive

I like the Click WheelUp|WheelDown. I'm not sure why it works like it does (I would think that it would scroll up|down 1 line at time, not 1 page at a time), but I'm not complaining. OK, not that much.

Thanks for the tip. I'll add it to the list of my other DOS-only hotkeys.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 6:24 am 
The wheel thingie is a pretty nice improvement. No flickering than with the menu solution. Thanks!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 9:33 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Too many Guests here...
Hey, JSLover, good one! It went to my list of permanent hotkeys.
Now, I need something to allow to search in the console...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 9:51 am 
PhiLho wrote:
Now, I need something to allow to search in the console...

Well, it's pretty easy to do based on my original suggestion:
Code:
#IfWinActive, ahk_class ConsoleWindowClass
^f::send, {alt down}{space}{alt up}ef
#IfWinActive


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 9:56 am 
It's even better if search direction is set backwards, so that the latest output is searched first:
Code:
#IfWinActive, ahk_class ConsoleWindowClass
+pgup::Click, WheelUp
+pgdn::Click, WheelDown
^f::send, {alt down}{space}{alt up}ef{alt down}u{alt up}{alt down}n{alt up}
#IfWinActive


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 9:58 am 
Until know the command prompt was almost unbearable for me after using the mature Linux terminals. With these improvements it's much more user friendly.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 10:04 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You have extended consoles all around the net with planty of supportive features...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 10:04 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Stupid me, I didn't noticed there was a search option in the console!
Note that the shortcuts you give won't work for me, using a French Windows... But it is easy to change them.

Hey, Guest, do you know you can use a nickname without even having to register? It is nicer to put a name on posts. There should be a JavaScript checking if you forget to fill the nickname field, it doesn't work for you? (just curiosity...) If not, do you have deactivated JS? Or what browser do you use?

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 10:11 am 
I'm a registered user here, but I made the first post as Guest out of pure lazyness.

Since I can't prove it was me who made the first post I continue to post as Guest here, so that I don't make the impression I'm taking credit for someone else's work.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 10:14 am 
majkinetor wrote:
You have extended consoles all around the net with planty of supportive features...


Any urls?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group