5

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
  • 2
    Select txt, Ctrl+X, move with arrow keys and Ctrl+V? (Cut and Paste) :)
    – HaydnWVN
    Feb 24, 2012 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, 2012 at 10:05

6 Answers 6

3

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

1
2

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

6
  • 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, 2012 at 11:24
  • 2
    That's why I said "apart from". I just wanted a better answer than the one available. Mar 21, 2012 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, 2012 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, 2012 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, 2012 at 14:48
1

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

1
  • 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, 2018 at 10:14
1

Thanks to @Mehper,

Here's the detailed answer (for people like me who are looking for a k/b only solution)
PROBLEM: I was looking for mouse keys for 'click-n-hold' operation as my mouse battery had died, and I had a constant need of clicking and dragging windows between laptop and the external monitor - and doing so with the touch-pad was a pain
SOLUTION: Searched for it literally the whole day enter image description here
src: MouseKeys

To get the effect of press and hold the left click, use the Button Lock button as shown in the pic

Try it once, twice and you'll get the hang of it, thnx

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Aug 2, 2023 at 18:50
0

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.

2
  • 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, 2019 at 10:59
  • There are no global line moving shortcuts. They depend on the text editor
    – phuclv
    Mar 14, 2020 at 13:22
0

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

1
  • 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. Nov 28, 2020 at 23:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .