Website based auto key assignment switching

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links or images until they have at least 4 posts.
Post Reply
Netherquark
New User
Posts: 5
Joined: Wed Oct 14, 2020 7:50 am

Website based auto key assignment switching

Post by Netherquark »

XMBC Version: 2.19.2
Windows Version: Windows 10(20H2) x64
Mouse Information (brand/model): HP KM300F included mouse
Relevant Computer Information (CPU, RAM etc): R3 2200G, TUF Gaming B450+, DDR4 2133MHz, Vega 8
Did the problem occur after an upgrade of XMBC? (If so, from what version?): No
Did the problem occur after a Windows update/upgrade? (If so, from what version?): No
How long have you used XMBC?: 1 day
What language and keyboard layout do you use in Windows?: English (US) on QWERTY layout

I am not having any problems. Rather I am here to suggest a feature. Could you please create a Chrome extension of sorts that links with the app and changes the assignments according to the website? For example, I want my side button 1 to pause the video on Youtube, and I want it to mute/unmute on Google Meet. This currently can't be set to automatically change as all these websites are under one program (Chrome) so the program can attach just one config to autoapply to it. This can be accomplished by manually changing layouts according to the website you are on, but this would be way more convenient.

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

Re: Website based auto key assignment switching

Post by phil »

You can create profiles and use the Window Caption to identify specific web pages. I know nothing about creating chrome extensions and have no interest in doing so - but you should need to do this. Just create a window specific profile for chrome and use the caption box to identify the specific page, using regular expressions you can use a caption search like .*[Yy]ou[Tt]ube.*

Having said that, I believe chrome is an awkward one because the caption is usually "chrome legacy window" and the parent window's caption is the one you need to look for - this is more difficult because XMBC does not provide a simple way to search for parent windows - but you can do it. You need to select "Parent Window" in the match type and then find the right window properties to search for (I use Spy++ for this but there are other tools).

This should work for YouTube in the latest chrome:
chrome.png
You do not have the required permissions to view the files attached to this post.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

Netherquark
New User
Posts: 5
Joined: Wed Oct 14, 2020 7:50 am

Re: Website based auto key assignment switching

Post by Netherquark »

Having said that, I believe chrome is an awkward one because the caption is usually "chrome legacy window" and the parent window's caption is the one you need to look for - this is more difficult because XMBC does not provide a simple way to search for parent windows - but you can do it. You need to select "Parent Window" in the match type and then find the right window properties to search for (I use Spy++ for this but there are other tools).
Could you help me out with that please? I cant figure out the window properties part and the parent window thing.

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

Re: Website based auto key assignment switching

Post by phil »

The screen shot above should be what you need for chrome.
The only thing you should need to change is the regular expression for the caption (which is setup for YouTube).

But I can only help if you tell me exactly what you are trying to detect - The most important bit - what is the title of the web page (the name on the tab in Chrome)!!
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

Netherquark
New User
Posts: 5
Joined: Wed Oct 14, 2020 7:50 am

Re: Website based auto key assignment switching

Post by Netherquark »

i want it to work for m e e t . g o o g l e . c o m (sorry for the broken link I seemingly cant post external links)
The tab title is Google Meet until you join a meet
then, it becomes Meet - <meet code>

gaia
Dedicated
Posts: 40
Joined: Mon Nov 13, 2017 8:07 pm

Re: Website based auto key assignment switching

Post by gaia »

phil wrote:
Wed Oct 14, 2020 9:48 am
You can create profiles and use the Window Caption to identify specific web pages. I know nothing about creating chrome extensions and have no interest in doing so - but you should need to do this. Just create a window specific profile for chrome and use the caption box to identify the specific page, using regular expressions you can use a caption search like .*[Yy]ou[Tt]ube.*
Hi Phil

may I why ?

Code: Select all

.*[Yy]ou[Tt]ube.*

i can't understand [Yy] and [Tt] ,what do they mean ? An about * and ? they are windows wildcards , x-mouse can use windows wildcards like (*?) ,can't it ?

but the I can't understand the [ ]
The most important bit - what is the title of the web page (the name on the tab in Chrome)!!
that's an important information

thanks Phil
_____________
XMouse 's lover

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

Re: Website based auto key assignment switching

Post by phil »

OK thats part of regluar expressions, sorry I didnt realise thats what you were asking!

Regex (regular expressions) is an advanced text search/match technique. They are INCREDIBLY powerfull but also rather complex to understand (especially if you have never seen/used them before!

First, in the one I used .*[Yy]ou[Tt]ube.*
. means match any character
* means any number (zero or more) of that match
so .* means match zero or more of any any character (like a wildcard)
[] is a group, so [Yy] means match either Y or y (therefore ignore the case)

So at the end of the day, its saying match ANY window caption with YouTube or youtube anywhere in the text :)

Some good resources:
https://en.wikipedia.org/wiki/Regular_expression
https://regex101.com/
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

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

Re: Website based auto key assignment switching

Post by phil »

Netherquark wrote:
Wed Oct 14, 2020 6:09 pm
i want it to work for m e e t . g o o g l e . c o m (sorry for the broken link I seemingly cant post external links)
The tab title is Google Meet until you join a meet
then, it becomes Meet - <meet code>
In that case you may get away with the caption regex search expression:
^(Google Meet)|(Meet \- \S+)$

This is quite a complex (maybe too complex!) search expression but essentially means the window title MUST either be "Google Meet" OR "Meet - <code>"
See example here: https://regex101.com/r/56eL7d/1

Once you understand regex, you will realize how powerful it can be and how you can optimize it/tailor it to your needs!

Oh and you need 5 posts before links are allowed :)
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

Netherquark
New User
Posts: 5
Joined: Wed Oct 14, 2020 7:50 am

Re: Website based auto key assignment switching

Post by Netherquark »

lol ill look into what regex is I didn't know a thing about it
thanks for the prompt help.

gaia
Dedicated
Posts: 40
Joined: Mon Nov 13, 2017 8:07 pm

Re: Website based auto key assignment switching

Post by gaia »

phil wrote:
Wed Oct 14, 2020 9:48 am
You can create profiles and use the Window Caption to identify specific web pages. I know nothing about creating chrome extensions and have no interest in doing so - but you should need to do this. Just create a window specific profile for chrome and use the caption box to identify the specific page, using regular expressions you can use a caption search like .*[Yy]ou[Tt]ube.*

Having said that, I believe chrome is an awkward one because the caption is usually "chrome legacy window" and the parent window's caption is the one you need to look for - this is more difficult because XMBC does not provide a simple way to search for parent windows - but you can do it. You need to select "Parent Window" in the match type and then find the right window properties to search for (I use Spy++ for this but there are other tools).

This should work for YouTube in the latest chrome:
chrome.png
Hi Phil

may I ask you a question ?
have you tried with firefox v82 stable 64bit ?
Find window does not detect Parent Class ,maybe it's firefox update or it's xmouse
thanks

Image
Image
_____________
XMouse 's lover

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

Re: Website based auto key assignment switching

Post by phil »

Maybe the window does not have a parent - its not uncommon and not all windows have parents - especially browser tabs which are often sub-processes and therefore top level windows (not child windows) these days - my browser (waterfox which is a port of firefox) does the same. It shouldn't be a problem?!
What exactly is the problem here? Is it that XMBC is not activating the profile?
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

gaia
Dedicated
Posts: 40
Joined: Mon Nov 13, 2017 8:07 pm

Re: Website based auto key assignment switching

Post by gaia »

phil wrote:
Thu Oct 22, 2020 9:36 am
Maybe the window does not have a parent - its not uncommon and not all windows have parents - especially browser tabs which are often sub-processes and therefore top level windows (not child windows) these days - my browser (waterfox which is a port of firefox) does the same. It shouldn't be a problem?!
What exactly is the problem here? Is it that XMBC is not activating the profile?
hi Phil
It shouldn't be a problem?!
What exactly is the problem here? Is it that XMBC is not activating the profile?
the problem is that X-mouse (XMBC) does not activate the profile , and it doesn't work
could give a look to firefox or post a screenshot of waterfox ?
thanks Phil
_____________
XMouse 's lover

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

Re: Website based auto key assignment switching

Post by phil »

I will check with firefox but I'm at work at the moment so it will have to wait till at least I get home.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

gaia
Dedicated
Posts: 40
Joined: Mon Nov 13, 2017 8:07 pm

Re: Website based auto key assignment switching

Post by gaia »

phil wrote:
Thu Oct 22, 2020 10:12 am
I will check with firefox but I'm at work at the moment so it will have to wait till at least I get home.
Hi Phil
thanks
_____________
XMouse 's lover

Netherquark
New User
Posts: 5
Joined: Wed Oct 14, 2020 7:50 am

Re: Website based auto key assignment switching

Post by Netherquark »

Could you send a screenshot for what to input in the specific window settings for w w w . c o d e c a d e m y . c o m?

Post Reply