Understanding some cursor state

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
ABIVEN
Pro Scripter
Posts: 71
Joined: Sun Aug 07, 2005 7:22 pm
Location: PARIS

Understanding some cursor state

Post by ABIVEN » Fri Apr 12, 2013 12:43 pm

Hello

I have a five programmable mouse : via MacroScheduler the Fifth Button generally assignes a listbox.

But when I am in a given application , for example IrfanView, the Fifth Button assignes a specifical action via a shortcut (for example resizing an image)

That ‘s good ; but I wish something more : use the Fifth Button as backspace when a word or part of a word is highlighted by the cursor


Any ideas ?

Thanks

ABIVEN
Pro Scripter
Posts: 71
Joined: Sun Aug 07, 2005 7:22 pm
Location: PARIS

Post by ABIVEN » Mon Apr 15, 2013 4:52 pm

Let me explain better :

Suppose that pattern :

Image


I want to erase zer by simply clicking the 5th button of my mouse.

This button gets a shortcut Ctrl Alt X , hotkey of a Macro

I want to find the "ON EVENT" line instructions which order BACKSPACE when some caracters are highlighted

Thanks

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Apr 15, 2013 5:58 pm

I'm sure I'm missing something but.... If the mouse button is programmed to execute Ctrl Alt X , why? can't you have a macro with Ctrl Alt X as the hot key and all the macro needs in it is the one line.

Press Backspace

ABIVEN
Pro Scripter
Posts: 71
Joined: Sun Aug 07, 2005 7:22 pm
Location: PARIS

Post by ABIVEN » Mon Apr 15, 2013 7:56 pm

Hello JRL

1) I try , thanks to MS , to do the max with the Mouse and not with the Keyboard

2) Generally the 5th button (Ctrl Alt X) opens a listbox for somethings much more complicated than a simple BACKSPACE

3) In that case (BACKSPACE) the opening of a listbox would be a nuisance

4) The event "HILIGHTED CARACTERS" detected by the first lines of the macro must trigger BACKSPACE and exit

Regards

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Apr 15, 2013 8:38 pm

1) I try , thanks to MS , to do the max with the Mouse and not with the Keyboard
I understand, you want to do the backspace with the mouse not the keyboard.

2) Generally the 5th button (Ctrl Alt X) ...
Does the fifth mouse key send (Ctrl Alt X)? If you set a Macro Scheduler macro's hotkey to (Ctrl Alt X) does the mouse button execute the macro?

4) The event "HILIGHTED CARACTERS" detected by the first lines of the macro must trigger BACKSPACE and exit
Are you saying that the macro must detect that there are highlighted characters before it performs a backspace?

So if there are no highlighted characters, backspace would not occur?

ABIVEN
Pro Scripter
Posts: 71
Joined: Sun Aug 07, 2005 7:22 pm
Location: PARIS

Post by ABIVEN » Tue Apr 16, 2013 4:47 am

Hello JRL

Thanks Wholly Understood
Are you saying that the macro must detect that there are highlighted characters before it performs a backspace?

So if there are no highlighted characters, backspace would not occur?
Yes backspace would not occur and the listbox will open

I do it for other types of occurence and it works out fine ; here I searche the "ON EVENT HILIGHTED" process

Regards

ABIVEN
Pro Scripter
Posts: 71
Joined: Sun Aug 07, 2005 7:22 pm
Location: PARIS

Post by ABIVEN » Tue Apr 23, 2013 9:36 pm

In fact I didn’t work out the ON EVENT HIGHLIGHTED macro ... too bad
but the followings (idem old post jpuziano) inserted in the global macro are enough for what I was trying to find :

//Clear clipboard
Let>i0=
PutClipboard>i0
//Capture highlighted text to clipboard
Press CTRL
Send Character/Text>c
Release CTRL
Wait>0.2
GetClipboard>j0
If>j0=i0,Continue
//Highlighted text --> Backspace and Exit
Press Backspace
goto>Exit
Label>Continue
//Global Macro ; opens ListBox

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Apr 23, 2013 9:45 pm

@ABIVEN
Good find. Looks like it should work. Is it running off of your mouse button?

@jpuziano
Nice work jp. Wish I'd thought of that.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Apr 23, 2013 9:54 pm

Thanks... I'm guessing it was the following post:

Detect Image Data on Windows Clipboard plus Save and Restore

Ah yes... good times...
Out-Take from the above old post wrote:Beyond the above two methods, I'd still like to see (one day) commands added to Macro Scheduler that could accomplish this, something like this perhaps:
jpuziano wrote:TakeClipBoardSnapShot>
- writes to a structure in memory (or disk?) created by Macro Scheduler
- must be called before RestoreClipBoardfromSnapShot

RestoreClipBoardfromSnapShot>
- reads from a structure in memory (or disk?) created by Macro Scheduler
...but I know the Windows Clipboard is a complex thing and there are many more mainstream things to work on with the beta etc., so I know something like this might be a long time coming. Until then, at least we have the methods worked out so far.

If anyone has any more ideas on this, please jump in.
Well Marcus, have we come to the point in the road where Macro Scheduler might add these commands? Could these at least be added to the Wish List for future consideration? It would make things easier for those of us that write macros that make use of the Windows Clipboard to move data around... while allowing us to preserve whatever data the user may have just put into the clipboard via some other application.

By the way, for those learning the ins and outs of the Windows Clipboard, the link I posted in that old post above is still working, its an interesting read... and you might want to download these utilities while they are still available. Here's that link again:

ClipboardToFile.exe and FileToClipboard.exe

Thanks for considering the potential new commands suggested above Marcus and take care.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

ABIVEN
Pro Scripter
Posts: 71
Joined: Sun Aug 07, 2005 7:22 pm
Location: PARIS

Post by ABIVEN » Wed Apr 24, 2013 7:28 pm

@JRL
Looks like it should work. Is it running off of your mouse button?


Seems to work perfectly

Regards

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts