ctrl-c ctril-v

Discussion in 'Java' started by Roedy Green, Jan 24, 2013.

  1. Roedy Green

    Roedy Green Guest

    Is it possible to reconfigure copy paste to some other keystrokes
    besides ctrl-C ctrl-V either within Java or Windows entirely?

    They are quite inconveniently placed in a dsk layout.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    The first 90% of the code accounts for the first 90% of the development time.
    The remaining 10% of the code accounts for the other 90% of the development
    time.
    ~ Tom Cargill Ninety-ninety Law
     
    Roedy Green, Jan 24, 2013
    #1
    1. Advertising

  2. Roedy Green <> wrote:
    > Is it possible to reconfigure copy paste to some other keystrokes
    > besides ctrl-C ctrl-V either within Java or Windows entirely?
    > They are quite inconveniently placed in a dsk layout.


    Don't think it is possible...

    Even if it were, then whatever other letters (with Ctrl) would
    get the Copy and Paste functionality, they might conflict with
    some appliation's use for that respective other key.

    E.g., if you set Copy to Ctrl-J and Paste to Ctrl-K and maybe
    even Cut to Ctrl-Q, then you may run into problems with apps
    that use Ctrl-Q,J,K for other stuff.
     
    Andreas Leitgeb, Jan 24, 2013
    #2
    1. Advertising

  3. Roedy Green

    Arne Vajhøj Guest

    On 1/24/2013 7:23 AM, Roedy Green wrote:
    > Is it possible to reconfigure copy paste to some other keystrokes
    > besides ctrl-C ctrl-V either within Java or Windows entirely?


    Within a Java GUI it should be easy.

    It will not be as easy to outside of the Java GUI. And Java will
    not be the right language to hook into the OS/WM/GUI framework.

    > They are quite inconveniently placed in a dsk layout.


    But it is what people expect.

    Arne
     
    Arne Vajhøj, Jan 24, 2013
    #3
  4. Roedy Green

    Daniel Pitts Guest

    On 1/24/13 4:23 AM, Roedy Green wrote:
    > Is it possible to reconfigure copy paste to some other keystrokes
    > besides ctrl-C ctrl-V either within Java or Windows entirely?
    >
    > They are quite inconveniently placed in a dsk layout.
    >

    FWIW, on the Mac it is Command-C/V, which is more convenient since
    Command is a thumb-pressed key, not a pinky-pressed. This is true for
    most hot keys.

    The equivalent on a PC would be pressing the Alt key for most hot-keys.

    Having said that, a lot of applications allow you to remap hot keys, but
    it is per application. No global solution that I know of. Probably
    could be done.
     
    Daniel Pitts, Jan 24, 2013
    #4
  5. Roedy Green

    bob smith Guest

    On Thursday, January 24, 2013 6:23:53 AM UTC-6, Roedy Green wrote:
    > Is it possible to reconfigure copy paste to some other keystrokes
    >
    > besides ctrl-C ctrl-V either within Java or Windows entirely?
    >
    >
    >
    > They are quite inconveniently placed in a dsk layout.
    >
    > --
    >
    > Roedy Green Canadian Mind Products http://mindprod.com
    >
    > The first 90% of the code accounts for the first 90% of the development time.
    >
    > The remaining 10% of the code accounts for the other 90% of the development
    >
    > time.
    >
    > ~ Tom Cargill Ninety-ninety Law


    I used to use right-clicking on stuff to Copy/Paste in Windows. Or the menu bar. Or the copy and paste icons.

    Sometimes if I don't like a hotkey, I'll use a Macro program, and I'll tell it to generate the Control C keystroke if I hit F12 or something. There's a program called AutoHotkey for Windows that might do that.
     
    bob smith, Jan 24, 2013
    #5
  6. In article <>,
    Roedy Green <> wrote:

    > Is it possible to reconfigure copy paste to some other
    > keystrokes besides ctrl-C ctrl-V either within Java or
    > Windows entirely?
    >
    > They are quite inconveniently placed in a dsk layout.


    You can augment or replace the default key binding for a
    particular text component's "copy" and "paste" actions:

    <http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html>

    I've never tried to make a wholesale change.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Jan 24, 2013
    #6
  7. On 01/24/2013 12:16 PM, Daniel Pitts wrote:
    > On 1/24/13 4:23 AM, Roedy Green wrote:
    >> Is it possible to reconfigure copy paste to some other keystrokes
    >> besides ctrl-C ctrl-V either within Java or Windows entirely?
    >>
    >> They are quite inconveniently placed in a dsk layout.
    >>

    > FWIW, on the Mac it is Command-C/V, which is more convenient since
    > Command is a thumb-pressed key, not a pinky-pressed. This is true for
    > most hot keys.

    [ SNIP ]

    I am an extremely fast two-fingered typist...to me it doesn't matter. :)

    AHS
     
    Arved Sandstrom, Jan 24, 2013
    #7
  8. Roedy Green

    Daniel Pitts Guest

    On 1/24/13 11:20 AM, Arved Sandstrom wrote:
    > On 01/24/2013 12:16 PM, Daniel Pitts wrote:
    >> On 1/24/13 4:23 AM, Roedy Green wrote:
    >>> Is it possible to reconfigure copy paste to some other keystrokes
    >>> besides ctrl-C ctrl-V either within Java or Windows entirely?
    >>>
    >>> They are quite inconveniently placed in a dsk layout.
    >>>

    >> FWIW, on the Mac it is Command-C/V, which is more convenient since
    >> Command is a thumb-pressed key, not a pinky-pressed. This is true for
    >> most hot keys.

    > [ SNIP ]
    >
    > I am an extremely fast two-fingered typist...to me it doesn't matter. :)
    >
    > AHS
    >

    It's not always about speed. Comfort is part of it as well. I can type
    really fast with two fingers (thanks to apple iP{hone,ad,od}). My wrist
    gets tired doing so for long stretches.
     
    Daniel Pitts, Jan 24, 2013
    #8
  9. Roedy Green

    Jim Janney Guest

    Roedy Green <> writes:

    > Is it possible to reconfigure copy paste to some other keystrokes
    > besides ctrl-C ctrl-V either within Java or Windows entirely?
    >
    > They are quite inconveniently placed in a dsk layout.


    This is a good thing. Programmers should not copy/paste on a regular
    basis.

    But on Windows I normally use control-insert/shift-insert anyway. No
    need to reconfigure anything, it already works. That's the key marked
    "Ins", just left of the home key.

    --
    Jim Janney
     
    Jim Janney, Jan 25, 2013
    #9
  10. Roedy Green

    Lew Guest

    Jim Janney wrote:
    > Roedy Green writes:
    >> Is it possible to reconfigure copy paste to some other keystrokes
    >> besides ctrl-C ctrl-V either within Java or Windows entirely?

    >
    >> They are quite inconveniently placed in a dsk layout.

    >
    > This is a good thing. Programmers should not copy/paste on a regular
    > basis.


    Ridiculous assertion.

    I'm a programmer, and a good one at that, and I copy/paste dozens or hundreds
    of times a day.

    Code.

    --
    Lew
     
    Lew, Jan 25, 2013
    #10
  11. Roedy Green

    Jim Janney Guest

    Lew <> writes:

    > Jim Janney wrote:
    >> Roedy Green writes:
    >>> Is it possible to reconfigure copy paste to some other keystrokes
    >>> besides ctrl-C ctrl-V either within Java or Windows entirely?

    >>
    >>> They are quite inconveniently placed in a dsk layout.

    >>
    >> This is a good thing. Programmers should not copy/paste on a regular
    >> basis.

    >
    > Ridiculous assertion.


    I wan't entirely serious when I wrote that. However...

    Any time I find myself faced with a lot of similar code, I do start
    looking for ways to abstract out the similarities, in whatever language
    I happen to be working in. Java is particularly rich in ways to
    accomplish this. And for really trivial boilerplate code, any good
    programming editor should provide ways to generate that that are both
    more flexible and less error-prone than simple copy/paste. Again,
    Eclipse is particularly rich in ways to accomplish this.

    I stand by my ridiculous assertion :)

    --
    Jim Janney
     
    Jim Janney, Jan 25, 2013
    #11
  12. Roedy Green

    Lew Guest

    Jim Janney wrote:
    > Lew writes:
    >> Jim Janney wrote:
    >>> This is a good thing. Programmers should not copy/paste on a regular
    >>> basis.

    >
    >> Ridiculous assertion.

    >
    > I wan't entirely serious when I wrote that. However...
    >
    > Any time I find myself faced with a lot of similar code, I do start
    > looking for ways to abstract out the similarities, in whatever language
    > I happen to be working in. Java is particularly rich in ways to
    > accomplish this. And for really trivial boilerplate code, any good
    > programming editor should provide ways to generate that that are both
    > more flexible and less error-prone than simple copy/paste. Again,
    > Eclipse is particularly rich in ways to accomplish this.
    >
    > I stand by my ridiculous assertion :)


    It's too broad.

    Let's say I have a method name 'loadResourceFromBlarg()' and I'm programming with
    Eclipse or NetBeans or one of those editors. Now I could use Ctrl-space to get code
    completion, but if there are a number of 'loadResourceFromXxx()' methods, the completion
    list might take time. If there are many calls to the method of choice, I'll likely copy the
    method name once into the clipboard and repeatedly paste it.

    Let's say I'm importing static a bunch of members from a utility class.

    import static junit.framework.Assert.assertEquals
    import static junit.framework.Assert.assertNotNull;
    import static junit.framework.Assert.assertNotSame;
    import static junit.framework.Assert.assertTrue;

    It's much faster to copy "import static junit.framework.Assert.assert", repeatedly paste it
    and just type the part that varies.

    This type of thing comes up a *lot*, so I copy and paste on a regular and frequent
    basis. This has nothing to do with the refactoring of which you spoke.

    You're assertion was ridiculous because it banned legitimate uses of copy-paste.

    --
    Lew
     
    Lew, Jan 25, 2013
    #12
  13. Roedy Green

    Arne Vajhøj Guest

    On 1/24/2013 9:51 PM, Jim Janney wrote:
    > Lew <> writes:
    >> Jim Janney wrote:
    >>> Roedy Green writes:
    >>>> Is it possible to reconfigure copy paste to some other keystrokes
    >>>> besides ctrl-C ctrl-V either within Java or Windows entirely?
    >>>
    >>>> They are quite inconveniently placed in a dsk layout.
    >>>
    >>> This is a good thing. Programmers should not copy/paste on a regular
    >>> basis.

    >>
    >> Ridiculous assertion.

    >
    > I wan't entirely serious when I wrote that. However...
    >
    > Any time I find myself faced with a lot of similar code, I do start
    > looking for ways to abstract out the similarities, in whatever language
    > I happen to be working in. Java is particularly rich in ways to
    > accomplish this. And for really trivial boilerplate code, any good
    > programming editor should provide ways to generate that that are both
    > more flexible and less error-prone than simple copy/paste. Again,
    > Eclipse is particularly rich in ways to accomplish this.
    >
    > I stand by my ridiculous assertion :)


    Often code can be refactored, but sometimes it is not possible
    either because of the type of code or because projects can not
    depend on each other.

    But there are also a lot besides Java code. Various Java EE
    descriptor files, various log4j or Spring config files etc..

    I think most developer do their part of copy paste.

    Probably also get it wrong occasionally.

    :)

    Binding all this to snippet shortcuts is only practical
    for a few often used pieces. It will not work for the hundreds
    or thousands of more rarely used pieces.

    Arne
     
    Arne Vajhøj, Jan 25, 2013
    #13
  14. Roedy Green

    Roedy Green Guest

    On Thu, 24 Jan 2013 18:16:42 -0700, Jim Janney
    <> wrote, quoted or indirectly quoted
    someone who said :

    > Programmers should not copy/paste on a regular
    >basis.


    You mean should not clone code, right? Lots of copy paste is
    rearranging, refactoring, building tables from external sources etc.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    The first 90% of the code accounts for the first 90% of the development time.
    The remaining 10% of the code accounts for the other 90% of the development
    time.
    ~ Tom Cargill Ninety-ninety Law
     
    Roedy Green, Jan 25, 2013
    #14
  15. Roedy Green

    Jim Janney Guest

    Roedy Green <> writes:

    > On Thu, 24 Jan 2013 18:16:42 -0700, Jim Janney
    > <> wrote, quoted or indirectly quoted
    > someone who said :
    >
    >> Programmers should not copy/paste on a regular
    >>basis.

    >
    > You mean should not clone code, right? Lots of copy paste is
    > rearranging, refactoring, building tables from external sources etc.


    That is indeed the very thing that I mean, yes :) Although for most
    refactoring I find Eclipse's builtin tools superior to doing it
    manually.

    --
    Jim Janney
     
    Jim Janney, Jan 25, 2013
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Danny

    Implement Ctrl-C, Ctrl-V

    Danny, Aug 14, 2003, in forum: C++
    Replies:
    5
    Views:
    653
    CBFalconer
    Aug 15, 2003
  2. Danny

    Implement Ctrl-C, Ctrl-V

    Danny, Aug 14, 2003, in forum: C Programming
    Replies:
    5
    Views:
    668
    CBFalconer
    Aug 15, 2003
  3. Angus
    Replies:
    5
    Views:
    2,119
    Michael Rauscher
    Nov 18, 2006
  4. Replies:
    2
    Views:
    1,422
    Munna
    Jul 10, 2008
  5. Replies:
    0
    Views:
    560
Loading...

Share This Page