I have upgraded the board - please let me know if you have any problems

Paste under cursor and Firefox specific windows

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Paste under cursor and Firefox specific windows

Post by maxoku » Sun Apr 02, 2017 8:03 pm

Hi. It's a great application especially scrolling under cursor is a must for comfortable using :P. I was playing with it to add a function to 4th and 5th buttons for copying and pasting. Well copying is simple, but pasting not that much if a place where I want to paste text it's not active, I mean when I didn't click on it. It needs to activate the edit area and paste a text, as also paste on the selected text to replace it. So I made a simulated keys: during {LMB}{CTRL}v and it works great but only in Firefox. Not perfectly though, when I'm too fast and before pasting I click with LMB it with the LMB from simulated keys reads as double or triple click and it's not doing what I want :/. In other programs pasting doesn't work at all which is strange especially while it does strange things.

Next thing is that Firefox has an option to paste under the middle button. It works like {LMB}{CTRL}v while cursor is under the edit area but unfortunately not during but simple press, so it's not like what I want. Well I could change it manually in XMBC, but I don't want to lose the default middle click action which is opening links in new tabs and smooth scrolling. For some reason I can't by hovering capture any specific windows for it. If I could do I would also add another simulated keys while cursor would be under the address bar. Press {LMB}{CTRL}a{CTRL}v{RETURN} works great to simulate function paste and go.

Could you help me in any way with my problems? (WinXP x86, installed 2.15 version, Firefox v50)

User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Re: Paste under cursor and Firefox specific windows

Post by maxoku » Sun Apr 09, 2017 5:33 pm

I've got an idea from the right click. It's technically two actions in one. First is when the button is clicked (or hold) and the second when released. Second one is the context menu and the first one is like defected left click, but it seems exactly what I need. So I would like something like right click but instead of showing context menu it would paste a text. :P

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Sun Apr 09, 2017 5:48 pm

The closest you will get with that (I think) is to set simulated keystrokes to ctrl+v on button release?
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Re: Paste under cursor and Firefox specific windows

Post by maxoku » Sun Apr 09, 2017 7:04 pm

phil wrote:The closest you will get with that (I think) is to set simulated keystrokes to ctrl+v on button release?
What do you mean? To put {CTRL}v in simulated keys and choose method 2? If so then it doesn't work.

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Sun Apr 09, 2017 8:07 pm

OK, I'm not really all that clear what you are trying to achieve.
If you want the press of the right button to activate and the release to paste, you could try:
Simulated keystrokes, method 9
{PRESS}{LMB}{RELEASE}{CTRL}{RELEASE}v

That should send a left click when you press the button (to activate the window) and a ctrl+v when you release the button.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Re: Paste under cursor and Firefox specific windows

Post by maxoku » Sun Apr 09, 2017 8:33 pm

Not really. I think v should be before release just after ctrl, but even after fixing it doesn't work like I want and pastes two times also. Did you check how does it work in firefox and could be reproduce in any other application? And do you know how to grab a specific windows in firefox? Or how to reproduce the first part of right click (without drawing the context menu)?

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Sun Apr 09, 2017 8:36 pm

Sorry, I havnt checked anything, Ive been away this weekend ans too tired to concentrate properly :).
But {release} only works with the preceding key - which is why I suggested it twice as I did.
I'm not sure what you mean by grab a specific window in firefox? Do you mean a particular tab/page? I don't think that's possible.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Re: Paste under cursor and Firefox specific windows

Post by maxoku » Sun Apr 09, 2017 8:53 pm

With Firefox specific windows I mean anything, cuz XMBC's tool to grab by hover doesn't recognize anything. I would like to specifically grab edit field and address bar.

With the past under cursor I've made for firefox simulated keys: "during {LMB}{CTRL}v". It activates edit fields before pasting but also doesn't unselect selected text so it can paste on selected text also. It for some reason doesn't work in any other application.

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Sun Apr 09, 2017 9:04 pm

maxoku wrote:With Firefox specific windows I mean anything, cuz XMBC's tool to grab by hover doesn't recognize anything. I would like to specifically grab edit field and address bar.
Yes, that's not possible in Firefox I'm afraid, because quite simply, they are not independent windows as far as window handles are concerned. You might be able to do it with some Firefox plugin, but not XMBC I'm afraid. If the grabber does not detect it, its not a normal window. The same problem exists for html5 video in browsers too :(
With the past under cursor I've made for firefox simulated keys: "during {LMB}{CTRL}v". It activates edit fields before pasting but also doesn't unselect selected text so it can paste on selected text also. It for some reason doesn't work in any other application.
That may be timing related, does it make any difference if you put a {WAITMS:100} between {LMB} and {CTRL} - like: {LMB}{WAITMS:100}{CTRL}v

Try 200 too if 100 makes no difference!

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Re: Paste under cursor and Firefox specific windows

Post by maxoku » Sun Apr 09, 2017 10:21 pm

It doesn't make any difference with both values.

But I discovered something odd on this page. I'm using a simulated keys: during {LMB}{CTRL}v{RETURN}. And when I paste something here on posting page it reloads a whole age after pasting lol. It doesn't have such effect on any other page I use.

Before you ask why I added enter to keys I'll tell you that :P . In normal edit fields it doesn't read that enter (which is good for me) and in chat edit fields it automatically sends pasted text. It should work that way on address bar too but for some reason it doesn't exactly how I would like to. It just adds a pasted text to the existing address, cuz it doesn't select text immediately, unless I click on address bar before. So I would like to have a specific window for that address bar that I would send a different keys including select all (ctrl+a). Well maybe is there a way that other profile would work e.g. in upper part of the firefox window that consist the address bar?

And let me know if you find such plug-in for firefox, I would be very interested. :P

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Mon Apr 10, 2017 8:11 am

OK, I'll have to play around with this myself - I use Firefox so when I get a moment (maybe tonight) I will have a look.

As for the specific areas, right now, you can do window quadrants (quarters of windows) but not specific areas as such - although behind the scenes, the code would be relatively simple (the same) the user interface to se this up would require quite some work! I will see what I can do, but it might have to wait until the 2.17 beta run as 2.16 is close to release now - we shall see.

Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
maxoku
Dedicated
Posts: 84
Joined: Sun Apr 02, 2017 5:21 pm

Re: Paste under cursor and Firefox specific windows

Post by maxoku » Mon Apr 10, 2017 3:41 pm

OK, I'll wait when you'll have more time to look deeper into it. Thanks in advance.

By the way I've checked that something (maybe a script) on that page makes ctrl+enter to reload page or something like that. So in my simulated keys during {LMB}{CTRL}v{RETURN} it reads ctrl+enter and activates it. Is there a way to separate that enter from the rest of the keys that it won't read ctrl+enter?

And is there a way to separate that left click of my simulated keys from previous normal left clicks to prevent double and triple clicks?

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Mon Apr 10, 2017 6:15 pm

How it reads the keys depends on the method you choose.
If you choose method 1 or 2, it should work because the {ctrl} tag should only apply to the next key.
If you choose method 3 (during) however, as you have done, it sends all the key down commands when you press the button, and holds them until you release the button when it sends, in reverse, all the key up commands so the {CTRL} will apply to v and enter.

You *might* be able to add a {release}{ctrl} in there after the V but I dont know if that will work.

So if you choose method one or two it *should* work as required.
And is there a way to separate that left click of my simulated keys from previous normal left clicks to prevent double and triple clicks?
No. XMBC sends the key via the SendInput API into the windows keyboard/mouse buffer. A left click is a left click is a left click, no matter what or who sends it! There is no way to "separate" anything, other than by adding {WAITMS} type delays - which i guess you have already tried? I'm not sure how else you could separate anything?!
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Mon Apr 10, 2017 6:29 pm

to be honest, the complexity of the scripts your trying to do is exceeding the capabilities of the relatively light weight scripting in XMBC. You might be better off looking at a more complex and complete scripting language/program like autohotkey!
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

User avatar
phil
Site Admin
Posts: 4974
Joined: Sun Apr 06, 2003 11:12 pm

Re: Paste under cursor and Firefox specific windows

Post by phil » Mon Apr 10, 2017 6:50 pm

maxoku wrote:And let me know if you find such plug-in for Firefox, I would be very interested. :P
Unfortunately I dont know of any. Its just the only real way to operate/inter-operate with Firefox is via its own plugin architecture.

It is impossible (as far as I can see from many web searches) to inter-operate with Firefox from external applications (I'm sure the same is true of IE, Edge and Chrome too). For starters, they dont use traditional controls, but windowless controls - and accessing them from outside is not easy (may not even be possible). So anything rendered on the page, including the tab and address bar, is not accessible/detectable using the standard windows enumerator APIs (FindWindow etc), simply because they are not standard windows.

The only option therefore for profile separation would be on window regions/areas, and as I said before that's not currently possible, other than the window quadrants.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests