unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
       [not found] <v9acdpzhmm.fsf@marauder.physik.uni-ulm.de>
@ 2006-01-31 16:50 ` Reiner Steib
  2006-02-06  7:47   ` Juri Linkov
  0 siblings, 1 reply; 15+ messages in thread
From: Reiner Steib @ 2006-01-31 16:50 UTC (permalink / raw)


[ I though this question were more suitable on gnu.emacs.help,
  but I didn't get any answer there within ten days. ]

Hi,

AFAICS, C-mouse-1 and S-mouse-1 on tool bar icons call the same
command as mouse-1 (without modifier); mouse-2 and mouse-3 don't have
a binding at all.

Is it possible to bind C-mouse-1 or S-mouse-1 to some other command
(not the command bound to mouse-1)?  Is it possible to bind mouse-2 or
mouse-3?

Background: If mouse-1 on a tool bar icon is bound to `M-x
some-command', `C-u mouse-1' runs the command `C-u M-x some-command'
(similar for `C-u 42 ...') which is nice (e.g. `C-u <tool-bar>
<print-buffer>' can be used to print to a file).  But tool bar icons
are (mostly?) intended for novice users.  For this audience, it would
be nice to have the result of `C-u' available by pressing S-mouse-1 as
in other Gnome applications [1].

Bye, Reiner.

[1] I don't know if this permitted by the GNOME UI guidelines, but
    there are some examples:
    Firefox: Shift- and/or Ctrl-Reload bypass cache and/or proxy (IIRC).
    Thunderbird: Shift-Compose starts composing a mail message in "the
    other" format (plain text vs. HTML; depending on the default
    format).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-01-31 16:50 ` tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1? Reiner Steib
@ 2006-02-06  7:47   ` Juri Linkov
  2006-02-07 20:32     ` Reiner Steib
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2006-02-06  7:47 UTC (permalink / raw)


> AFAICS, C-mouse-1 and S-mouse-1 on tool bar icons call the same
> command as mouse-1 (without modifier); mouse-2 and mouse-3 don't have
> a binding at all.
>
> Is it possible to bind C-mouse-1 or S-mouse-1 to some other command
> (not the command bound to mouse-1)?  Is it possible to bind mouse-2 or
> mouse-3?

A good thing for mouse-3 to do on the tool bar icon is to display a popup
menu with more related actions, e.g. display a whole Customization submenu
on the Customization icon, all 6 printing-related items from the File
menu on the Printer icon, all 9 Search submenu items on the Search icon,
etc.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-06  7:47   ` Juri Linkov
@ 2006-02-07 20:32     ` Reiner Steib
  2006-02-08  9:18       ` Juri Linkov
  0 siblings, 1 reply; 15+ messages in thread
From: Reiner Steib @ 2006-02-07 20:32 UTC (permalink / raw)


On Mon, Feb 06 2006, Juri Linkov wrote:

>> AFAICS, C-mouse-1 and S-mouse-1 on tool bar icons call the same
>> command as mouse-1 (without modifier); mouse-2 and mouse-3 don't have
>> a binding at all.
>>
>> Is it possible to bind C-mouse-1 or S-mouse-1 to some other command
>> (not the command bound to mouse-1)?  Is it possible to bind mouse-2 or
>> mouse-3?

Is it already possible or not?  Anyone?

> A good thing for mouse-3 to do on the tool bar icon is to display a popup
> menu with more related actions, e.g. display a whole Customization submenu
> on the Customization icon, all 6 printing-related items from the File
> menu on the Printer icon, all 9 Search submenu items on the Search icon,
> etc.

I'm not a usability expert, but I think tool bar icon commands should
not popup menus (as the Emacs help icon does: duplicating the Help
menu item).

The different commands I have in mind for Gnus are variations of the
Reply command (e.g. with or without citing the text) or
gnus-summary-sort-by-whatever and the reverse sort.  As the icons and
command are customizable in Gnus (in the next version, see Gnus CVS)
the user can bind the most frequently used commands depending on
his/her usage pattern.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-07 20:32     ` Reiner Steib
@ 2006-02-08  9:18       ` Juri Linkov
  2006-02-08 17:36         ` Reiner Steib
  2006-02-09 21:22         ` tool bar: C-... and S-... fail in GTK builds (was: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?) Reiner Steib
  0 siblings, 2 replies; 15+ messages in thread
From: Juri Linkov @ 2006-02-08  9:18 UTC (permalink / raw)


>>> Is it possible to bind C-mouse-1 or S-mouse-1 to some other command
>>> (not the command bound to mouse-1)?  Is it possible to bind mouse-2 or
>>> mouse-3?
>
> Is it already possible or not?  Anyone?

(info "(elisp)Tool Bar") describes how to add modifiers to the fake
function keys in the tool bar, but really the following sample code
has no effect:

  (define-key tool-bar-map [S-help] 'info)

>> A good thing for mouse-3 to do on the tool bar icon is to display a popup
>> menu with more related actions, e.g. display a whole Customization submenu
>> on the Customization icon, all 6 printing-related items from the File
>> menu on the Printer icon, all 9 Search submenu items on the Search icon,
>> etc.
>
> I'm not a usability expert, but I think tool bar icon commands should
> not popup menus (as the Emacs help icon does: duplicating the Help
> menu item).

I think only mouse-1 should not popup menus, but in many modern
applications mouse-3 is a standard way to show a popup menu
with a complete list of items related to the main item invoked
via mouse-1.

> The different commands I have in mind for Gnus are variations of the
> Reply command (e.g. with or without citing the text) or
> gnus-summary-sort-by-whatever and the reverse sort.

Good idea.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-08  9:18       ` Juri Linkov
@ 2006-02-08 17:36         ` Reiner Steib
  2006-02-09 17:34           ` Juri Linkov
  2006-02-09 21:22         ` tool bar: C-... and S-... fail in GTK builds (was: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?) Reiner Steib
  1 sibling, 1 reply; 15+ messages in thread
From: Reiner Steib @ 2006-02-08 17:36 UTC (permalink / raw)


On Wed, Feb 08 2006, Juri Linkov wrote:

> (info "(elisp)Tool Bar") describes how to add modifiers to the fake
> function keys in the tool bar, but really the following sample code
> has no effect:
>
>   (define-key tool-bar-map [S-help] 'info)

`<f1> k [C-help]' crashed Emacs here, but maybe it was not directly
related to that action.  (See emacs-pretest-bug, MID
<v9oe1hg44k.fsf@marauder.physik.uni-ulm.de> or later on
<http://thread.gmane.org/v9oe1hg44k.fsf@marauder.physik.uni-ulm.de>).

>>> A good thing for mouse-3 to do on the tool bar icon is to display a popup
>>> menu with more related actions, [...]
>>
>> I'm not a usability expert, but I think tool bar icon commands should
>> not popup menus (as the Emacs help icon does: duplicating the Help
>> menu item).
>
> I think only mouse-1 should not popup menus, but in many modern
> applications mouse-3 is a standard way to show a popup menu
> with a complete list of items related to the main item invoked
> via mouse-1.

I don't recall an application offering a menu on mouse-3 specific to a
certain tool bar button.  E.g. Firefox 1.5 displays the same as <Menu>
<View> <Toolbars> does, no matter at which tool bar position you click
<mouse-3>.  But I agree that <mouse-3> in Emacs could do as you
suggest.

>> The different commands I have in mind for Gnus are variations of the
>> Reply command (e.g. with or without citing the text) or
>> gnus-summary-sort-by-whatever and the reverse sort.
>
> Good idea.

Thanks.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-08 17:36         ` Reiner Steib
@ 2006-02-09 17:34           ` Juri Linkov
  2006-02-09 21:18             ` Reiner Steib
  2006-02-10  6:57             ` Jan D.
  0 siblings, 2 replies; 15+ messages in thread
From: Juri Linkov @ 2006-02-09 17:34 UTC (permalink / raw)


>> I think only mouse-1 should not popup menus, but in many modern
>> applications mouse-3 is a standard way to show a popup menu
>> with a complete list of items related to the main item invoked
>> via mouse-1.
>
> I don't recall an application offering a menu on mouse-3 specific to a
> certain tool bar button.  E.g. Firefox 1.5 displays the same as <Menu>
> <View> <Toolbars> does, no matter at which tool bar position you click
> <mouse-3>.

What I meant is that in Firefox [mouse-3] on a tab pops up a menu of
tab-related actions other than activating a tab as [mouse-1] does.
Also [mouse-3] on a link pops up a menu of link-related actions,
on an image - a menu of image-related actions and so on.  Emacs could do
the same for the toolbar icons.  Even in Firefox [mouse-3] on the [Back]
toolbar button displays a list of all previous nodes.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-09 17:34           ` Juri Linkov
@ 2006-02-09 21:18             ` Reiner Steib
  2006-02-10  6:57             ` Jan D.
  1 sibling, 0 replies; 15+ messages in thread
From: Reiner Steib @ 2006-02-09 21:18 UTC (permalink / raw)


On Thu, Feb 09 2006, Juri Linkov wrote:

>> I don't recall an application offering a menu on mouse-3 specific to a
>> certain tool bar button.  E.g. Firefox 1.5 displays the same as <Menu>
>> <View> <Toolbars> does, no matter at which tool bar position you click
>> <mouse-3>.
>
> What I meant is that in Firefox [mouse-3] on a tab pops up a menu of
> tab-related actions other than activating a tab as [mouse-1] does.
> Also [mouse-3] on a link pops up a menu of link-related actions,
> on an image - a menu of image-related actions and so on.  Emacs could do
> the same for the toolbar icons.

I agree.  But it doesn't seem to be possible in Emacs yet to bind
mouse-2 or mouse-3 on tool bar icons.

> Even in Firefox [mouse-3] on the [Back] toolbar button displays a
> list of all previous nodes.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* tool bar: C-... and S-... fail in GTK builds (was: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?)
  2006-02-08  9:18       ` Juri Linkov
  2006-02-08 17:36         ` Reiner Steib
@ 2006-02-09 21:22         ` Reiner Steib
  2006-02-10  0:57           ` tool bar: C-... and S-... fail in GTK builds Juri Linkov
  1 sibling, 1 reply; 15+ messages in thread
From: Reiner Steib @ 2006-02-09 21:22 UTC (permalink / raw)


On Wed, Feb 08 2006, Juri Linkov wrote:

>>>> Is it possible to bind C-mouse-1 or S-mouse-1 to some other command
>>>> (not the command bound to mouse-1)?  Is it possible to bind mouse-2 or
>>>> mouse-3?
>>
>> Is it already possible or not?  Anyone?
>
> (info "(elisp)Tool Bar") describes how to add modifiers to the fake
> function keys in the tool bar, but really the following sample code
> has no effect:
>
>   (define-key tool-bar-map [S-help] 'info)

Did you try with a GTK build?  It fails with GTK for me, but it works
with an X toolkit build:

In GNU Emacs 22.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2006-01-24 on bridgekeeper
X server distributor `The X.Org Foundation', version 11.0.60801000
configured using `configure '--with-x-toolkit=yes''

(define-key tool-bar-map [C-dired] 'info)  ;; works
(define-key tool-bar-map [S-dired] 'man)   ;; works
(define-key tool-bar-map [C-help] 'info)   ;; works 
(define-key tool-bar-map [S-help] 'man)    ;; works

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: C-... and S-... fail in GTK builds
  2006-02-09 21:22         ` tool bar: C-... and S-... fail in GTK builds (was: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?) Reiner Steib
@ 2006-02-10  0:57           ` Juri Linkov
  2006-02-14 10:10             ` Jan D.
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2006-02-10  0:57 UTC (permalink / raw)


>>   (define-key tool-bar-map [S-help] 'info)
>
> Did you try with a GTK build?  It fails with GTK for me, but it works
> with an X toolkit build:

Yes, it failed for me with a GTK build, and now I've verified that
it works with a non-toolkit build.  So there is a bug in GTK builds.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-09 17:34           ` Juri Linkov
  2006-02-09 21:18             ` Reiner Steib
@ 2006-02-10  6:57             ` Jan D.
  2006-02-11  1:03               ` Juri Linkov
  1 sibling, 1 reply; 15+ messages in thread
From: Jan D. @ 2006-02-10  6:57 UTC (permalink / raw)
  Cc: emacs-devel

Juri Linkov wrote:

>>>I think only mouse-1 should not popup menus, but in many modern
>>>applications mouse-3 is a standard way to show a popup menu
>>>with a complete list of items related to the main item invoked
>>>via mouse-1.
>>>      
>>>
>>I don't recall an application offering a menu on mouse-3 specific to a
>>certain tool bar button.  E.g. Firefox 1.5 displays the same as <Menu>
>><View> <Toolbars> does, no matter at which tool bar position you click
>><mouse-3>.
>>    
>>
>
>What I meant is that in Firefox [mouse-3] on a tab pops up a menu of
>tab-related actions other than activating a tab as [mouse-1] does.
>Also [mouse-3] on a link pops up a menu of link-related actions,
>on an image - a menu of image-related actions and so on.  Emacs could do
>the same for the toolbar icons.  Even in Firefox [mouse-3] on the [Back]
>toolbar button displays a list of all previous nodes.
>  
>

I for one dislike that.  For example, the normal mouse-3 menu in Firefox 
has "Reload" and "Back", which I use from time to time.  But if you 
happen to be over a link or an image when you click mouse-3, there is no 
"Back" or "Reload" in those menus.  Quite annoying.

    Jan D.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-10  6:57             ` Jan D.
@ 2006-02-11  1:03               ` Juri Linkov
  2006-02-12 18:17                 ` Jan Djärv
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2006-02-11  1:03 UTC (permalink / raw)
  Cc: emacs-devel

>>What I meant is that in Firefox [mouse-3] on a tab pops up a menu of
>>tab-related actions other than activating a tab as [mouse-1] does.
>>Also [mouse-3] on a link pops up a menu of link-related actions,
>>on an image - a menu of image-related actions and so on.  Emacs could do
>>the same for the toolbar icons.  Even in Firefox [mouse-3] on the [Back]
>>toolbar button displays a list of all previous nodes.
>
> I for one dislike that.  For example, the normal mouse-3 menu in Firefox
> has "Reload" and "Back", which I use from time to time.  But if you happen
> to be over a link or an image when you click mouse-3, there is no "Back"
> or "Reload" in those menus.  Quite annoying.

But you don't dislike popup menus bound to mouse-3 in principle,
you only dislike the concrete Firefox menu on some contexts, right?

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?
  2006-02-11  1:03               ` Juri Linkov
@ 2006-02-12 18:17                 ` Jan Djärv
  0 siblings, 0 replies; 15+ messages in thread
From: Jan Djärv @ 2006-02-12 18:17 UTC (permalink / raw)
  Cc: emacs-devel

Juri Linkov wrote:
>>>What I meant is that in Firefox [mouse-3] on a tab pops up a menu of
>>>tab-related actions other than activating a tab as [mouse-1] does.
>>>Also [mouse-3] on a link pops up a menu of link-related actions,
>>>on an image - a menu of image-related actions and so on.  Emacs could do
>>>the same for the toolbar icons.  Even in Firefox [mouse-3] on the [Back]
>>>toolbar button displays a list of all previous nodes.
>>
>>I for one dislike that.  For example, the normal mouse-3 menu in Firefox
>>has "Reload" and "Back", which I use from time to time.  But if you happen
>>to be over a link or an image when you click mouse-3, there is no "Back"
>>or "Reload" in those menus.  Quite annoying.
> 
> 
> But you don't dislike popup menus bound to mouse-3 in principle,
> you only dislike the concrete Firefox menu on some contexts, right?
> 

Right.

	Jan D.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: C-... and S-... fail in GTK builds
  2006-02-10  0:57           ` tool bar: C-... and S-... fail in GTK builds Juri Linkov
@ 2006-02-14 10:10             ` Jan D.
  2006-02-14 17:43               ` Juri Linkov
  0 siblings, 1 reply; 15+ messages in thread
From: Jan D. @ 2006-02-14 10:10 UTC (permalink / raw)
  Cc: emacs-devel



Juri Linkov wrote:
>>>   (define-key tool-bar-map [S-help] 'info)
>> Did you try with a GTK build?  It fails with GTK for me, but it works
>> with an X toolkit build:
> 
> Yes, it failed for me with a GTK build, and now I've verified that
> it works with a non-toolkit build.  So there is a bug in GTK builds.

I've fixed it now.  The modifiers are not available for the callback that GTK 
invokes when a button is clicked, so previously I just set the modifiers to 
zero.  I didn't realize there was a use for them.

	Jan D.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: C-... and S-... fail in GTK builds
  2006-02-14 10:10             ` Jan D.
@ 2006-02-14 17:43               ` Juri Linkov
  2006-02-15 10:57                 ` Jan D.
  0 siblings, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2006-02-14 17:43 UTC (permalink / raw)
  Cc: emacs-devel

>>>>   (define-key tool-bar-map [S-help] 'info)
>>> Did you try with a GTK build?  It fails with GTK for me, but it works
>>> with an X toolkit build:
>> Yes, it failed for me with a GTK build, and now I've verified that
>> it works with a non-toolkit build.  So there is a bug in GTK builds.
>
> I've fixed it now.  The modifiers are not available for the callback that
> GTK invokes when a button is clicked, so previously I just set the
> modifiers to zero.  I didn't realize there was a use for them.

Thanks!   Could you see how hard would be to implement mouse-2 and mouse-3
clicking on a tool bar item?  Is the main obstacle only in the format
of the menu keymap specification?

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: tool bar: C-... and S-... fail in GTK builds
  2006-02-14 17:43               ` Juri Linkov
@ 2006-02-15 10:57                 ` Jan D.
  0 siblings, 0 replies; 15+ messages in thread
From: Jan D. @ 2006-02-15 10:57 UTC (permalink / raw)
  Cc: emacs-devel

> >>>>   (define-key tool-bar-map [S-help] 'info)
> >>> Did you try with a GTK build?  It fails with GTK for me, but it works
> >>> with an X toolkit build:
> >> Yes, it failed for me with a GTK build, and now I've verified that
> >> it works with a non-toolkit build.  So there is a bug in GTK builds.
> >
> > I've fixed it now.  The modifiers are not available for the callback that
> > GTK invokes when a button is clicked, so previously I just set the
> > modifiers to zero.  I didn't realize there was a use for them.
> 
> Thanks!   Could you see how hard would be to implement mouse-2 and mouse-3
> clicking on a tool bar item?  Is the main obstacle only in the format
> of the menu keymap specification?

It is not hard on the C level.  we can put the button clicked in the code
part of the struct input_event, and keyboard.c would then look at that
also when constructing an event (currently code is ignored for tool bar
events).

But I don't know to construct the Lisp event.  It could be done like
for native scroll bars.  It is a mouse-event with a position that says
scroll bar.  But the lisp code expects the position to contain a window,
but for non-native tool bars (i.e. GTK) there is no window to put in
there, just a frame.

	Jan D.


	Jan D.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-02-15 10:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <v9acdpzhmm.fsf@marauder.physik.uni-ulm.de>
2006-01-31 16:50 ` tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1? Reiner Steib
2006-02-06  7:47   ` Juri Linkov
2006-02-07 20:32     ` Reiner Steib
2006-02-08  9:18       ` Juri Linkov
2006-02-08 17:36         ` Reiner Steib
2006-02-09 17:34           ` Juri Linkov
2006-02-09 21:18             ` Reiner Steib
2006-02-10  6:57             ` Jan D.
2006-02-11  1:03               ` Juri Linkov
2006-02-12 18:17                 ` Jan Djärv
2006-02-09 21:22         ` tool bar: C-... and S-... fail in GTK builds (was: tool bar: mouse-2, mouse-3, C-mouse-1, S-mouse-1?) Reiner Steib
2006-02-10  0:57           ` tool bar: C-... and S-... fail in GTK builds Juri Linkov
2006-02-14 10:10             ` Jan D.
2006-02-14 17:43               ` Juri Linkov
2006-02-15 10:57                 ` Jan D.

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).