I love using an IDE, because I get some great productivity gains. However, I have a couple reasons to stop using a mouse with an IDE:
To code faster - It definitely slows down my coding when my typing is interrupted with all of the constant point and clicking.
To relieve pain - I've never had pain from the keyboard, but I get tendinitis from the mouse.
I've got my cheat sheet for my IDE printed out and now I'm ready.
What's the best way get off the mouse?
Are there any hurdles that I'm going to run into?
Are there any tips for specific IDEs (Visual Studio, Eclipse, etc.) ?
Move it to the wrong side (eg if you are right handed then put it on the left of the keyboard). That way, you can still use it if necessary, but you should find you aren't using it unecessarily.
If changing sides isn't enough to confuse your brain, then moving it to a place where it is accessible but you have to think before reaching for it. As long as you can't reach for the mouse without thinking about it, then you will find that it is easier to use keyboard shortcuts instead. Essentially you want the mouse to be an option but the keyboard to be a better/easier/more convenient one!
As for pitfalls, well you may find that if you have to test any interfaces (web based or dektop) that you need to revert back to using the mouse. Also I find that if I have to work outside of the IDE, then it is just not as efficient to do without the mouse. Often we use WOrd for specifications and documentation, and trying to get away with using that without a mouse, is tricky (in my experience).
Another potential source of annoyance, is when switching between applications (Eclipse, VS, etc), you find that they often use different keyboard shortcuts, and so it can take a while to get back up to speed again, or you have to spend some time reconfiguring the shortcuts to be consistent.
Unplug it.
If your mouse is completely gone then you will be forced to learn how to live without it and therefore will become productive without it.
Anytime you're about to use the mouse, forcibly stop yourself and look up the keyboard shortcut for that operation. Do that a few times per operation and soon your muscle memory will kick in and you won't even have to think about it anymore.
Learn the keyboard short cuts :)
Also some editors are better suited for mouse free operation. I use ViEmu with Visual Studio which has helped me reduce, but not eliminate the need for using the mouse.
Get a trackball.
Your real question is about pain and productivity, the mouse is just a by-product of your circumstances. I would rephrase the question to reflect your real purpose.
Check out the wrist braces. I've heard from people that it makes a huge difference.
For VS, check out Sara Ford's blog.
Bind Macros to Keyboard Shortcuts
Keyboard Shortcuts to navigate task list
Search her blog for plenty of other tips and tricks.
Use the command line whenever you can (Install Powershell)
Switch to vim or emacs for code editing (or use ViEmu if you really need the intellisense)
If you develop web applications and/or spend a lot of time on the web, get the Vimperator or Firemacs extensions
Learn keyboard shortcuts for everything else.
???
Profit!!! (from your increased productivity)
Hide the mouse under a copy of your cheat sheet.
For visual studio I use the ViEmu plugin that allows you to use vi commands in visual studio. It's a bit difficult to get the hang of it but once you're done you'll only be using the mouse on the designer.
Get a webcam and eye-tracking software. Then you can fix bugs just by looking at them. It makes you feel all-powerful.
I've summed up some shortcuts that will get you working faster with Visual Studio in my blog.
I recommend you start at this article, that shows you the shortcuts I'd recommend you should get to know first...
Switch to emacs.
Open the nearest drawer and shove it in and close the drawer. That way, when you really do need it it'll be inconvenient to use it!!!
Also, if you're using multiple IDEs it pays to configure key bindings that are common across them, so that you can switch between them easily.
Change your keys to Emacs setup , Learn the Keyboard Shortcuts. I rarely use the mouse, if ever, in eclipse. i find it alot easier to just use emacs key short cuts.
When I contracted for an investment bank in NYC, there was this guy who didn't use a mouse. He was a java/kdb dev and just used vim. I used to think it was the strangest thing that he didn't have a mouse attached to his computer, but damn.. that guy was productive. Probably the most productive guy I've ever worked with.
So yea, if you really want to go that route you could try using vim, or something similar. You'll lose the features you're used to in your IDE, but it worked for him...
Become a better typer. As a slow
typer, I find myself going to the
mouse so I dont have to type. If I
were more efficient at typing, I would
be less inclined to use the mouse.
If you are using a laptop and a
mouse, remove the mouse and leave the
trackpad as your only option. That
will be so painful that you will be
forced to learn more keyboard
shortcuts.
Some very good answers above.
I spent a while injured with RSI and mousing was an issue. I already used shortcuts a LOT.
But coding using strictly the keyboard was definitely slower, especially when it comes to navigating around the code.
As I was using vi at the time, I would primarily move around the screen by doing searches for text at the location I wanted to go to; this is very fast, assuming you pick unambiguous text. Leaving line-numbers on and then going to the line number is another way to rapidly navigating. Judicious use of code folding (available in many IDEs) helps, too.
Finally, consider an alternate pointing device. A trackpad sucks for games but can be more accessible for coding, especially if you put it in easy reach of the keys (e.g., if you use a split keyboard, between the two hands). Try switching between two or more styles of device, to avoid injury because of one specific device. And don't ignore wrist pain! Treat it before it gets worse and you end up non-productive for a year or something.
Configure your IDE to use VI or EMACS keyboard controls (and learn them.) Both options allow you do do most tasks without moving your hands of the home row. You'll see your productivity drop during the learning curve but jump way up after as you save a lot of time by not moving your hand of the keyboard to use the mouse.
As a side note, learning to use a terminal based editor is a good skill to have in case you ever need to remotely administer a *nix machine. It will save your bacon some day.
MouseFeeds plugin will help you in eclipse:
http://www.mousefeed.com/installation
All these coders and no one suggested to write some code to hide the pointer when the IDE's window is active??
Great question... A co-worker suggested Launchy to me as a way to reduce mouse-use/be more productive. It searches your Start Menu (or non-windows equivalent) for apps, docs, shortcuts, etc. Type alt+spacebar to bring up its prompt where you type what you want to launch. Here are a few examples - what you type depends on other things in your Start Menu.
ch for Chrome, f for Firefox
ca for Calculator
expl for Windows Explorer
A power-user can fiddle with its settings to get more out of it but even basic users will benefit from it. Hope it helps.
Change your keyboard:
(source: datahand.com)
Hide your mouse - at least one arm's length away - then you can always get it back in an emergency
Move it far enough away that it's inconvenient to use, while your cheat sheet is close enough to easily lookup whenever you are in doubt about how to do something. I would not suggest unplugging it, since it is a useful tool for some operations, such as moving files around. I find drag and drop in some sort of tree like file system view is much easier than the alternatives. The majority of editing operations though, are quickly accomplished via key strokes once you remember them.
I am using IntellijIDEA IDE. There is one very annoying plugin - "Key promoter".
For every mouse-inited action it shows annoying alert with keyboard shortcut which you could use to do the same action.
Well, it took about 2 or 3 weeks for me to stop using mouse at all. It was hard to not turn it off (plugin), but very useful :)
IMHO the best answer is combination of two already given answers:
Print out the keyboard shortcut cheat sheet of your IDE and tape it to the wall next to the screen.
Unplug it. Also this makes a bit harder to procrastinate by switching to SO in the other window...
You may also want to consider doing your coding on a Macbook/Macbook pro. I generally HATE touchpads, but I've had to do some coding on the plane and the new touch-sensitive pads are actually really convenient. For example, you can do things like scrolling with a flick of two singers, and it's a lot more accurate.
It may not be perfect, but it might help with your hands.
I don't think avoiding the mouse completely is practical (you need things like hovers, etc.)
First off, don't try to do everything with a keyboard, start by forcing yourself to use keyboards for the top 3 things that you do all the time. Get the biggest bang for your buck/effort and you will quickly want to use more.
Keep a sheet of paper near by where you write down keyboard short cuts you use. (Alternatively, add this to a company wiki so others can benefit.)
Pay attention to menu items, they frequently have keyboard short cuts.
Find out the keyboard shortcuts that show all other keyboard short cuts.
I use Eclipse all the time, there are several keyboard short cuts that I find invaluable:
CTRL + SPACE - Content Assist
CTRL + 3 - Open any UI Element in eclipse by typing
CTRL + SHIFT + T - Open by type (Uses Capital letters to do word searches and * for wild card, for instance NuPoEx would find NullPointerException)
ALT + SHIFT + R - Rename current selection
ALT + SHIFT + T - Refactor Menu
And CTRL+SHIFT + L gives you a list of all keyboard shortcuts
Related
I am currently helping a blind person to learn Java using Eclipse as their IDE. However, when there are errors, e.g. a typo, the red underlines indicating an error are not useful/apparent.
How can blind users be made aware of errors or other visual indicators within Eclipse?
In eclipse you can use Ctrl+. and Ctrl+, to navigate forwards and backwards through underlined sections.
When the cursor is in an underlined section, the error is shown in the status bar which your screen reader may be able to read (with JAWS use Insert+PgDn or CapsLock+PgDn).
There are some more tips for Eclipse's accessibility features in the Eclipse Help pages.
Jaws normally says "invalid" before each invalid part of code in the code editor as you navigate with arrow keys.
You have nothing specific to configure for this. At least for me, it worked out of the box from day 1.
IN case of doubt or if it doesn't work out of the box, you can customize the way Jaws behaves by going to the setting center.
More specifically, in the speech and sound scheme, you might pick a modern scheme different than classic, or want to customize the way the "invalid" font style is announced.
You will also certainly need to pay triple attention to things that eclipse automatically insert for you as you type, like closing parens and braces, as they aren't announced at all by Jaws when they are automatically inserted. They can easily make you enter unwanted extra characters.
As a blind user I prefer to completely disable all autocompletes like this and only keep it on demand with shortcuts like F2, but that's a personal choice.
Unfortunately, I can't help if you are using NVDA, but there certainly are solutions as well.
I'm using Intellij for Java development. In the code editor on the right, it displays some yellow markers which indicate issue with my code, e.g. improvement suggestions. When I hover over the affected code line it tell me what to do. Unfortunately I didn't find a way of automatically applying said suggestion. How do I do that? I don't want to do fixes by hand but rather allow Intellij to do them for convenience.
CTRL + Space is only code completion.
Just place the cursor over the highlighted code, hit Alt+Enter, select the suggested fix and hit Enter.
You can also apply the fix for all problems of the given type within specified scope (current file, project, ...). If you want to do that, just select Run inspection on from the menu that is shown.
I'm not sure if there is a way to apply these fixes automatically completely without user intervention, but even if there was, it probably wouldn't be very user friendly, as the warnings are sometimes false-positive.
If you want to apply a code suggestion it it simply Alt+Enter while the cursor is over the highlighted code. I would strongly suggest not automatically applying suggestions and to use your better judgement.
I can personally attest that while it's a little extra work, being able to choose the suggestions validity is much better. There's been more than a few times when the suggestion wouldn't make sense in the context.
As a sidenote I'd suggest having a reference for the KB shortcuts open so you can improve your speed within the IDE: Mac or Windows/Linux
I have used Eclipse for Java for the last few years and am trying out Intellij. I'm not using it permanently because it isn't as useful for quick programming (like how you can't just drag in files into the src folder) but for doing certain things, I think it will be faster for me.
I know there is Ctrl+Shift+Enter, but this is just annoying to press. Not because it is awkward to press, but because it takes so much time compared to just pressing enter like you can in Eclipse. I tried to rebind it to enter, but then it just doesn't work.
Is there a way to set up the Complete Current Statement so that it happens when I press enter?
Like, is there a way that I can bind it to Enter, but have it checked before the editor checks for enter as move to next line?
If you want only basic Code completion and not Type completion, use Ctrl+Space
IntelliJ and Android Studio are pretty highly customisable. You can rebind shortcuts too, I believe. Have you looked here? https://www.jetbrains.com/idea/help/configuring-keyboard-shortcuts.html
Also cheatsheet might be of use: https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf
And Android specific bindings: https://developer.android.com/sdk/installing/studio-tips.html
First a disclaimer, I'm a Java programmer and have almost no idea about the Windows API. So please bear with me.
My goal is to use Java to capture a hidden window. My target platform is Windows. I do understand that the Robot class is used for capuring the visible part of the screen. After some browsing, I came across these three links, which seem to be relevant:
http://www.support.teamdev.com/thread/1930
http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.ui/2006-02/msg00204.html
http://www.fengyuan.com/article/wmprint.html
JxCapture is as bloodily expensive as Feng Yuan article is complicated. My question is this, if the gurus in this forum can help me find a reasonable solution. The approach suggested in JxCapture does not seem to be overly complex. Any hints? A visual basic script or some C# code that does this would be a good starting point.
I was of the belief that when the window is hidden, if I send a keypress event or a mouse press event to it, it would force it to redraw itself and hence allow itself to be captured even by java.awt.Robot. That was an illusion and it doesn't work.
On the other hand, the message in the JxCapture thread is from the year 2006; could it be that Sun has included such a feature since then and I'm just not aware of it?
I want to be able to record mouse movements, clicks and keyboard input from a user. It would be great if it was a cross platform solution.
I'd like to get back something like this (pseudo code):
mouse moved to 500, 500
mouse double clicked
mouse moved to 800, 300
mouse left clicked
keyboard typed "Hello World"
Does either C++ or Java have any classes that can do this? If I was using C++, I would probably working with the QT framework.
Edit:
I should have said this originally, but I want to record the movements and clicks outside of the applications gui, so on the desktop too.
GLUT does this, but it's tied to OpenGL which might be overkill for your project.
OpenGL is cross-platform.
I don't believe there's a cross-platform toolkit specifically for grabbing input from a window and nothing more, but most toolkits provide this capability. Two good options are:
Use SDL, as it's fairly lightweight and can handle simple input.
Implement the functionality natively per platform, as it should be trivial in X11, Windows, Mac OS X, etc.
On Windows, this is called a Journal Record Hook. You should write the hook part in C or C++, it might be technically possible to do in java, but it's not a good idea, you want your hook procedure to have as few dependencies as possible, and to be a quick as possible. System wide hooks, especially journal add a lot of overhead to keyboard and mouse input, you want to minized your impact as much as possible.
You Install Windows hooks by using SetWindowsHookEx passing WH_JOURNALRECORD to get a Journal Record Hook.
You could also (maybe) get this working by installing both WH_KEYBOARD_LL and WH_MOUSE_LL, but your two hook procedures would be called separately, and you would have to write your own code to put the events in order.
I doubt you will find a cross-platform solution.
It sounds like Qt might allow you to implement event filters that extend beyond the application to the window system. See also Qt - top level widget with keyboard and mouse event transparency?
If you want to trap events across the whole GUI system, not just one app, there's not much likelihood of a cross platform solution. However, the event hooking part could easily be separated from the recording part, so you could make most of the program cross-platform.
For Windows, you need this 17 year old (!) document. (Man, I'm getting old!)