DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: close tab with right click in opera  (Read 14,078 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
IDEA: close tab with right click in opera
« on: October 01, 2011, 01:15 PM »
hello

when I right click on the empty area of the webpage, I would like to close the current viewing tab in Opera

this right click closing, should not work when I have selected text, when I have put the cursor inside a text input box, when I right click on a graphics file, when I right click on a link, when I right click on a selected text etc

can anyone implement this?

thanks!!
« Last Edit: October 01, 2011, 03:47 PM by jgpaiva »

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
Re: IDEA: close tab with right click in opera
« Reply #1 on: October 01, 2011, 04:31 PM »
instead of having to check for "selected text, when I have put the cursor inside a text input box, when I right click on a graphics file, when I right click on a link, when I right click on a selected text etc", consider using a mouse rocker (hold down right button and click left button or hold down left button and click right button) to send the "close tab" command.

Then it becomes a very short and simple ahk script.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: IDEA: close tab with right click in opera
« Reply #2 on: October 01, 2011, 04:42 PM »
IMHO, using the close button on the Tab is more intuitive then selecting a Close Tab entry from the context menu. But I removed all instances of Opera from my system, because I was never using them, so I can't even check if that button is there :o

Defining a mouse-gesture to close a tab should also be fairly easy, if it's not pre-defined.
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: IDEA: close tab with right click in opera
« Reply #3 on: October 01, 2011, 04:56 PM »
Defining a mouse-gesture to close a tab should also be fairly easy, if it's not pre-defined.

When browsing through the help I found this default mouse gesture:
Quote
Close tab hold right button, move down then right
Just tested it with Opera 11.51, and it worked like a charm :D

Also tried in FF (7.0.1) with FireGestures add-in, and it has the same gesture doing that action :up:
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: IDEA: close tab with right click in opera
« Reply #4 on: October 01, 2011, 05:01 PM »
Just tested it with Opera 11.51
Yup, I re-installed ;D
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: IDEA: close tab with right click in opera
« Reply #5 on: October 01, 2011, 05:44 PM »
mouse rocker is already an option that I use in opera, but what I am asking is far more convenient imo

as for closing a tab by clicking the close button on the tab, is inconvenient because you have to move the mouse to the tab to close it

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: close tab with right click in opera
« Reply #6 on: October 02, 2011, 03:21 PM »
kalos, is the down-right mouse gesture suggestion good enough for your purposes?  If so, I'll mark this thread as solved.

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: IDEA: close tab with right click in opera
« Reply #7 on: October 02, 2011, 03:53 PM »
kalos, is the down-right mouse gesture suggestion good enough for your purposes?  If so, I'll mark this thread as solved.

mm, not really, because it is not that convenient (esp. when using touchpad) and because I use ahk scripts that prevent this

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: IDEA: close tab with right click in opera
« Reply #8 on: October 07, 2011, 04:47 PM »
hello, any update to this?

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: close tab with right click in opera
« Reply #9 on: October 07, 2011, 04:51 PM »
@kalos: Your original request of a single right-click would be very difficult to do reliably.  How about a double-right-click or some other sort of modifier like ctrl-right-click, etc.?

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: IDEA: close tab with right click in opera
« Reply #10 on: October 07, 2011, 06:29 PM »
@kalos: Your original request of a single right-click would be very difficult to do reliably.  How about a double-right-click or some other sort of modifier like ctrl-right-click, etc.?

double click or even middle click would be the closest, but why single right click wouldn't be reliable?

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: close tab with right click in opera
« Reply #11 on: October 07, 2011, 06:37 PM »
double click or even middle click would be the closest, but why single right click wouldn't be reliable?

Because, when working externally with a web browser, it's difficult (if not impossible) to know what type of control the mouse is over.  Programmatically, it all looks like one large control instead of individual text boxes, edit fields, etc.  Does that make sense?

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: IDEA: close tab with right click in opera
« Reply #12 on: October 07, 2011, 06:47 PM »
double click or even middle click would be the closest, but why single right click wouldn't be reliable?

Because, when working externally with a web browser, it's difficult (if not impossible) to know what type of control the mouse is over.  Programmatically, it all looks like one large control instead of individual text boxes, edit fields, etc.  Does that make sense?

yup, but javascript can interact with webpage elements (maybe other languages too)

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: close tab with right click in opera
« Reply #13 on: October 07, 2011, 06:55 PM »
Here's an AHK snippet that will let you middle-click to close a tab in Opera:

Code: (autohotkey)
SetTitleMatchMode, 2

#IfWinActive, Opera ahk_class OperaWindowClass
{
    MButton:: SendInput, ^w
}
#IfWinActive

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: IDEA: close tab with right click in opera
« Reply #14 on: October 07, 2011, 07:03 PM »
Here's an AHK snippet that will let you middle-click to close a tab in Opera:

Code: (autohotkey)
SetTitleMatchMode, 2

#IfWinActive, Opera ahk_class OperaWindowClass
{
    MButton:: SendInput, ^w
}
#IfWinActive

but it should not work when the cursor is inside text box, when text is selected, etc :D
I too think it's difficult, but thanks anyway!

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: IDEA: close tab with right click in opera
« Reply #15 on: October 07, 2011, 07:10 PM »
but it should not work when the cursor is inside text box, when text is selected, etc :D
I too think it's difficult, but thanks anyway!

Change it to use a modifier like ctrl-middle-click:  ^MButton:: SendInput, ^w

Original address: https://www.donationcoder.com/forum/index.php?topic=28204.0