Shortcut key to clear console in Eclipse

时光总嘲笑我的痴心妄想 提交于 2019-12-03 06:39:01

问题


What is the shortcut key to clear console in Eclipse or how can it be configured? Any work-arounds to achieve this?


回答1:


It does not appear to be a way, as there's a bug filled regarding this issue on bugs.eclipse.org.




回答2:


I know this thread is already 3 years old, but if someone is still looking for it, in Indigo the shortcut is Shift - F10 followed by r.

Cheers.




回答3:


I found a solution for the wiping the console in an Eclipse IDE. It uses the Robot class. Please see code below and caption for explanation:

   import java.awt.AWTException;
   import java.awt.Robot;
   import java.awt.event.KeyEvent;

   public void wipeConsole() throws AWTException{
        Robot robbie = new Robot();
        //shows the Console View
        robbie.keyPress(KeyEvent.VK_ALT);
        robbie.keyPress(KeyEvent.VK_SHIFT);
        robbie.keyPress(KeyEvent.VK_Q);
        robbie.keyRelease(KeyEvent.VK_ALT);
        robbie.keyPress(KeyEvent.VK_SHIFT);
        robbie.keyPress(KeyEvent.VK_Q);
        robbie.keyPress(KeyEvent.VK_C);
        robbie.keyRelease(KeyEvent.VK_C);

        //clears the console
        robbie.keyPress(KeyEvent.VK_SHIFT);
        robbie.keyPress(KeyEvent.VK_F10);
        robbie.keyRelease(KeyEvent.VK_SHIFT);
        robbie.keyRelease(KeyEvent.VK_F10);
        robbie.keyPress(KeyEvent.VK_R);
        robbie.keyRelease(KeyEvent.VK_R);
    }

Assuming you haven't changed the default hot key settings in Eclipse and import those java classes, this should work.




回答4:


This thread is 7 years old now, but I constantly need to clean the console so i can get work done. Thanks to sbanders I made this AutoHotKey script:

#`::
WinGetTitle, Title, ahk_class SWT_Window0
if InStr(Title, "Eclipse") {
  WinActivate, ahk_class SWT_Window0
  Send +!q
  Sleep, 1200
  Send c
  Send +{F10}r
}
return 

What this means is the following.

  • When the user presses WinKey + Backtic (this can easily be changed to a different hotkey),
  • If an Eclipse window exists
  • Activate that window and press CTRL + SHIFT + q (opens navigation context menu)
  • Wait 1.2 seconds (wait time probably depends on system specs)
  • Press c (Will focus on console view)
  • Press SHIFT + F10 + r (Clears console)
  • End script

It's a very handy script for coders who don't like clicking so I thought I'd share it.




回答5:


When I right-click inside the console window and select 'clear' it clears my console. I'm using Windows 10.

If you press Shift+F10+r that works.




回答6:


Press Shift + Alt + Q followed by C to set focus to console.

Then press Shift+F10 followed by R to clear it.



来源:https://stackoverflow.com/questions/1672428/shortcut-key-to-clear-console-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!