Associate paste action with Shift+MiddleButton - Xwindows

This is a discussion on Associate paste action with Shift+MiddleButton - Xwindows ; Hi, is there a simple way to associate the paste action with shift+MiddleButton rather than MiddleButton only? Sometimes when using the scrolling wheel on the mouse I accidentally press the middle button. It happened to me recently that a text ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Associate paste action with Shift+MiddleButton

  1. Associate paste action with Shift+MiddleButton

    Hi,

    is there a simple way to associate the paste action with
    shift+MiddleButton rather than MiddleButton only?

    Sometimes when using the scrolling wheel on the mouse I accidentally
    press the middle button. It happened to me recently that a text got
    pasted like this into a document without me noticing and the result
    was extremely embarrasing.

    So I figured it would be nice to require a modifier like Shift or
    AltGr to actually do the paste to avoid the problem.

    Is there a simple way to achieve this?

    Thanks.

    Filip

  2. Re: Associate paste action with Shift+MiddleButton

    Filip Ginter wrote:
    >Hi,
    >
    >is there a simple way to associate the paste action with
    >shift+MiddleButton rather than MiddleButton only?
    >
    >Sometimes when using the scrolling wheel on the mouse I accidentally
    >press the middle button. It happened to me recently that a text got
    >pasted like this into a document without me noticing and the result
    >was extremely embarrasing.
    >
    >So I figured it would be nice to require a modifier like Shift or
    >AltGr to actually do the paste to avoid the problem.
    >
    >Is there a simple way to achieve this?
    >
    >Thanks.
    >
    >Filip


    Well, it can be done by running a simple app that passively grabs
    button2 on the root window, discards the event if not shifted, else
    fakes an unshifted event using the test extension.

    But it is probably better just to get in the habit of clearing the
    selection after you do a paste.



  3. Re: Associate paste action with Shift+MiddleButton

    Yes, that's my current setup. I grab all button2 clicks and discard
    them and fake button2 for every shift+Button2. I use xbindkeys and
    xmacroplay for this.

    But that requires me to shift any button2 click. I would only want to
    shift the paste action. Somewhere in X, either in some header file
    or some config file must be a line that assigns paste to button2. If I
    only could find that line...

    Filip

    > Well, it can be done by running a simple app that passively grabs
    > button2 on the root window, discards the event if not shifted, else
    > fakes an unshifted event using the test extension.
    >
    > But it is probably better just to get in the habit of clearing the
    > selection after you do a paste.


  4. Re: Associate paste action with Shift+MiddleButton

    Filip Ginter wrote:
    >Yes, that's my current setup. I grab all button2 clicks and discard
    >them and fake button2 for every shift+Button2. I use xbindkeys and
    >xmacroplay for this.
    >
    >But that requires me to shift any button2 click. I would only want to
    >shift the paste action. Somewhere in X, either in some header file
    >or some config file must be a line that assigns paste to button2. If I
    >only could find that line...
    >
    >Filip
    >
    >> Well, it can be done by running a simple app that passively grabs
    >> button2 on the root window, discards the event if not shifted, else
    >> fakes an unshifted event using the test extension.
    >>
    >> But it is probably better just to get in the habit of clearing the
    >> selection after you do a paste.


    Please don't top post.

    You must understand that in X, as in Windos, the application
    determines what is ultimately done with any keystroke or mouse action.
    Cut&Paste or Drag&Drop are usually implemented by the application
    calling appropriate libraries or using appropriate widgets to achieve
    their purpose: there is no external guarantee that button2 means
    paste.

    There is no single config file, nor can there be such a config file,
    that alters the paste action in a global sense. You may be able to
    alter any specific application by changing a resource file. For
    example, what you want is easily done in xterm.

    The best you can do then, is to effect such a change in the
    applications that *you* use, if this is possible. As I stated
    previously, this would not be my solution.

    I suppose there could be a follow-up thread on unusable mice...


  5. Re: Associate paste action with Shift+MiddleButton

    kbr@pangea.ca (Kip Rugger) wrote in message news:...
    > Filip Ginter wrote:
    > >Yes, that's my current setup. I grab all button2 clicks and discard
    > >them and fake button2 for every shift+Button2. I use xbindkeys and
    > >xmacroplay for this.
    > >
    > >But that requires me to shift any button2 click. I would only want to
    > >shift the paste action. Somewhere in X, either in some header file
    > >or some config file must be a line that assigns paste to button2. If I
    > >only could find that line...
    > >
    > >Filip
    > >
    > >> Well, it can be done by running a simple app that passively grabs
    > >> button2 on the root window, discards the event if not shifted, else
    > >> fakes an unshifted event using the test extension.
    > >>
    > >> But it is probably better just to get in the habit of clearing the
    > >> selection after you do a paste.

    >
    > Please don't top post.
    >
    > You must understand that in X, as in Windos, the application
    > determines what is ultimately done with any keystroke or mouse action.
    > Cut&Paste or Drag&Drop are usually implemented by the application
    > calling appropriate libraries or using appropriate widgets to achieve
    > their purpose: there is no external guarantee that button2 means
    > paste.
    >
    > There is no single config file, nor can there be such a config file,
    > that alters the paste action in a global sense. You may be able to
    > alter any specific application by changing a resource file. For
    > example, what you want is easily done in xterm.
    >
    > The best you can do then, is to effect such a change in the
    > applications that *you* use, if this is possible. As I stated
    > previously, this would not be my solution.
    >
    > I suppose there could be a follow-up thread on unusable mice...



    OK. Probably I misunderstood the way X and the primary buffer work
    with respect to the paste action. Thank you for your answer, I guess
    I'm not going to dig into every single application I use, that would
    be quite insane indeed.

    Filip

+ Reply to Thread