I want to write a script to quickly switch tabs in Chrome
Hello! I have this idea: The wheel in my mouse actually has "tilt right" and "tilt left" buttons on the mousewheel, so I figured it would be very practical to switch tabs in google chrome using this feature. I've looked for chrome plugins and found none (If you know one, please tell me and save me of all this trouble) . I have veeeery basic C knowledge so I'm not attempting to make a running code in this post, but my attempt on the general structure is the following:
I can use the keyboard shortcut 'ctrl+x', being x the tab number, and it will switch to that tab (i.e. if I put ctrl+3, it will switch to the third tab). That means Chrome has stored in some place the tab number, which if i could gain access to, I could make something like this:
int tab=x // the tab number im actually at, idk how to access that
void loop(){
if (LeftTiltButton) {
x--
type (ctrl + x); //idk how to tell my keyboard to type something with a script
}
if (rightTiltButton){
x++
type (ctrl+x);
}
}
Here are my problems:
- I don't have any idea how to access to the tab number im currently at
- I don't know where or how to implement the script
- I'm not sure if with my current programming knowledge I could make a running code
How or where can I start to learn the knowledge required to do this mini-proyect? It's the first one I've tried by my own.
Posted Jun 4, 2020, 11:21 PM UTC