If I select some text in a text input field/area/window, I can drag that text to another position somewhere within the text area using the mouse. Is it possible to do this dragging using the keyboard?
I can imagine some global key shortcut existing that would allow me to "drag" the text selection using the arrow keys; maybe even using keys like "End" and Page Up".

  • 2
    Select txt, Ctrl+X, move with arrow keys and Ctrl+V? (Cut and Paste) :)
    – HaydnWVN
    Feb 24 '12 at 9:53
  • 2
    Avoiding copy/cut-pasting is one of the main reasons I want to do this in the first place—don't want to lose what's on my clipboard. :P Feb 24 '12 at 10:05

Your best bet would be to use MouseKeys. It's one of the accessibility features of Windows 2000, XP, Vista and 7.


Apart from using MouseKeys, it's not possible out of the box. You could probably create this functionality using something like AutoHotkey.

  • 3
    But mouse keys is built into Windows. That is "Out of the box" Did you just want to answer your own question?
    – Joe Taylor
    Mar 20 '12 at 11:24
  • 2
    That's why I said "apart from". I just wanted a better answer than the one available. Mar 21 '12 at 14:52
  • But the one you gave and accepted wasn't in any way better. If you want a better answer offer a bounty and leave the question unanswered.
    – Joe Taylor
    Mar 21 '12 at 15:22
  • I also look for a way to use the keyboard to move selected text for the same reason as the answerer. The other answer presented here is terrible. It shows you a solution to use the mouse to move selected text, but at the enormous cost of losing your numeric keypad. Now if there were a way to turn mouse keys off and on with a keyboard shortcut then it might be an acceptable solution. Jun 14 '12 at 13:47
  • @oscilatingcretin: Actually, you can toggle it with Alt+Shift+NumLock, but I still think it's hardly a solution. windows.microsoft.com/en-US/windows-xp/help/turn-on-mousekeys Jun 14 '12 at 14:48

I just know moving lines in some editors. In Notepad++ it's Ctrl+Shift+Up/Down which moves the line up or down.

  • You can do something similar in Visual Studio: hold alt and use the arrow keys up and down to move the current line up or down. Doesn't work for selections, though; only complete lines. Mar 9 '18 at 10:14

Try Shift+Alt+Up Arrow or Shift+Alt+Down Arrow. This should move the highlighted text up and down within a larger body of text.

  • 1
    Hm, no that does not seem to work. I tried in Chrome (address bar, text field, Google Docs document) and in Notepad, but it doesn't work. (It does move lines in Google Docs.) In what software did you find it working? Jun 21 '19 at 10:59
  • There are no global line moving shortcuts. They depend on the text editor
    – phuclv
    Mar 14 '20 at 13:22

In Visual Studio Code you can hold Alt + Up/Down Arrow Keys to move lines of code all at once without any highlighting.

  • This doesn’t seem to be a universal solution. In what environment have you seen it work? … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
    – Scott
    Nov 28 '20 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.