Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

why can't I send ctrl-x or ctrl-v with this?


  • Please log in to reply
4 replies to this topic
mcms
  • Guests
  • Last active:
  • Joined: --
Could someone please explain to me why this doesn' t work on my computer? If I switch ^x and ^v with Msgbox messages, it works as I would expect. In its current state, it doesn't seem to work.

Try highlighting some text with your left mouse button. While still holding the left button down, click/release the middle mouse button. It is supposed to cut the text but does not work.
MButton::
    GetKeyState, lstate, LButton, P
    if lstate = D 
        Send ^x 
    else
        MouseClick,M

RButton::
    GetKeyState, lstate, LButton, P
    if lstate = D
       Send ^v
    else
       MouseClick,R


Sivvy
  • Members
  • 726 posts
  • Last active: Apr 23 2010 02:50 PM
  • Joined: 21 Jul 2008
~LButton & MButton::Send ^x

~LButton & RButton::Send ^v

Does that work?

Razlin
  • Members
  • 454 posts
  • Last active: Feb 05 2014 06:21 PM
  • Joined: 05 Nov 2007
one thing for sure your missing your returns

MButton::
    GetKeyState, lstate, LButton, P
    if lstate = D
        Send ^x
    else
        MouseClick,M
[color=red]return[/color]

RButton::
    GetKeyState, lstate, LButton, P
    if lstate = D
       Send ^v
    else
       MouseClick,R
[color=red]return[/color]


yoru script right now is executing both mbutton and rbutton. so you are doing cut and paste.

check yoru clipboard.. its probably working you jsut forgot the return
-=Raz=-

  • Guests
  • Last active:
  • Joined: --
Thank you very much for the suggestions.

~LButton & MButton::Send ^x

~LButton & RButton::Send ^v

Does that work?


This has the same behavior (as in it doesn't work either) but is way more concise code.

yoru script right now is executing both mbutton and rbutton. so you are doing cut and paste.

check yoru clipboard.. its probably working you jsut forgot the return


I thought this as well and moved them into functions with returns a bit ago:

cutFunction()
{
    GetKeyState, lstate, LButton, P
    if lstate = D 
    {
        Send ^x
    } else
        MouseClick,M
    return
}

pasteFunction()
{
    GetKeyState, lstate, LButton, P
    if lstate = D
    {
       Send ^v
    } else
       MouseClick,R
    return
}

MButton::cutFunction()
RButton::pasteFunction()

Still doesn't work...


What's really weird is that no solution will work in programs like notepad. But if I try using the paste function into the search bar in Internet explorer, it works. If I try to paste in the URL bar of IE, it doesn't work. The cut function does not work in any program, ever.

I am completely baffled as to why these don't work in the first place and why I'm seeing thes inconsistencies. Does anyone have an idea?

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
Cut works for me in Firefox and Notepad++. It may be that some controls won't accept any other input until the mouse input is released.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image