FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 11-12-2010, 07:02 AM
Kamaraju S Kusumanchi
 
Default map '-' to '_' and '_' to '-'

While working on my Debian box (which btw is a mix of Lenny and Squeeze), I
find that I type the underscore character ('_') more often than the dash
character ('-'). It could be file names, variable names while writing code
etc.,

Typing '_' involves holding the shift key while typing '-' does not involve
any. I am wondering if there is a way at the OS (or shell) level solution to
remap '-', '_' one to another so that typing '_' does not involve holding
shift key but typing '-' does.

Any ideas/comments/suggestions/pointers etc.,?

thanks
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: ibis8b$4dc$1@dough.gmane.org">http://lists.debian.org/ibis8b$4dc$1@dough.gmane.org
 
Old 11-12-2010, 08:10 AM
Andrew Peng
 
Default map '-' to '_' and '_' to '-'

Hello!

Please take a look and see if this helps

http://www.columbia.edu/~djv/docs/keyremap.html



--Andrew



On Fri, Nov 12, 2010 at 2:02 AM, Kamaraju S Kusumanchi
<raju.mailinglists@gmail.com> wrote:
> While working on my Debian box (which btw is a mix of Lenny and Squeeze), I
> find that I type the underscore character ('_') more often than the dash
> character ('-'). It could be file names, variable names while writing code
> etc.,
>
> Typing '_' involves holding the shift key while typing '-' does not involve
> any. I am wondering if there is a way at the OS (or shell) level solution to
> remap '-', '_' one to another so that typing '_' does not involve holding
> shift key but typing '-' does.
>
> Any ideas/comments/suggestions/pointers etc.,?
>
> thanks
> raju
> --
> Kamaraju S Kusumanchi
> http://malayamaarutham.blogspot.com/
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/ibis8b$4dc$1@dough.gmane.org
>
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTin=8B+RcftWNkfJv6h1VaqxDkgfGP=5pnN_ssYC@mail .gmail.com">http://lists.debian.org/AANLkTin=8B+RcftWNkfJv6h1VaqxDkgfGP=5pnN_ssYC@mail .gmail.com
 
Old 11-12-2010, 12:33 PM
Rob Owens
 
Default map '-' to '_' and '_' to '-'

On Fri, Nov 12, 2010 at 03:02:00AM -0500, Kamaraju S Kusumanchi wrote:
> While working on my Debian box (which btw is a mix of Lenny and Squeeze), I
> find that I type the underscore character ('_') more often than the dash
> character ('-'). It could be file names, variable names while writing code
> etc.,
>
> Typing '_' involves holding the shift key while typing '-' does not involve
> any. I am wondering if there is a way at the OS (or shell) level solution to
> remap '-', '_' one to another so that typing '_' does not involve holding
> shift key but typing '-' does.
>
Use xmodmap and/or a .Xmodmap file in your home directory. You man need
to use xev to find the keycodes.

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101112133310.GA26052@aurora.owens.net">http://lists.debian.org/20101112133310.GA26052@aurora.owens.net
 
Old 11-12-2010, 07:38 PM
Mitchell Laks
 
Default map '-' to '_' and '_' to '-'

On 03:02 Fri 12 Nov , Kamaraju S Kusumanchi wrote:
> While working on my Debian box (which btw is a mix of Lenny and Squeeze), I
> find that I type the underscore character ('_') more often than the dash
> character ('-'). It could be file names, variable names while writing code
> etc.,

i have noticed the same thing. now if we all programmed in lisp this would not be a problem
I considered switching to common lisp from perl and C and C++ for this reason

Mitchell


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101112203859.GC25103@earthlink.net">http://lists.debian.org/20101112203859.GC25103@earthlink.net
 
Old 11-12-2010, 08:54 PM
Cameron Hutchison
 
Default map '-' to '_' and '_' to '-'

Rob Owens <rowens@ptd.net> writes:

>On Fri, Nov 12, 2010 at 03:02:00AM -0500, Kamaraju S Kusumanchi wrote:
>> While working on my Debian box (which btw is a mix of Lenny and Squeeze), I
>> find that I type the underscore character ('_') more often than the dash
>> character ('-'). It could be file names, variable names while writing code
>> etc.,
>>
>> Typing '_' involves holding the shift key while typing '-' does not involve
>> any. I am wondering if there is a way at the OS (or shell) level solution to
>> remap '-', '_' one to another so that typing '_' does not involve holding
>> shift key but typing '-' does.
>>
>Use xmodmap and/or a .Xmodmap file in your home directory. You man need
>to use xev to find the keycodes.

The X11 keysyms for these characters are "minus" and "underscore". If
you run "xmodmap -pke | grep underscore" you should see which keycode has
these keysyms mapped.

For me, this is:
$ xmodmap -pke | grep underscore
keycode 20 = minus underscore minus underscore

I suspect that's a standard keyboard keycode so you'll get the same
results, but run it anyway to be sure.

You can remap this like so:
$ xmodmap -e "keycode 20 = underscore minus underscore minus"

That swaps minus and underscore.

You can put the part between quotes in your ~/.Xmodmap file and GNOME
should auto-load it (although I think I remember reading something
lately that this may change).

Finally, I suggest you not do this. I've make changes to my standard
keyboard in the past and when you switch to someone elses keyboard you
just get annoyed :-) I used to map CapsLock to Ctrl, but if you get too
used to that, YOU JUST END UP SHOUTING when you only meant to press
Ctrl.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5b5d.4cddb78d.c66fd@getafix.xdna.net">http://lists.debian.org/5b5d.4cddb78d.c66fd@getafix.xdna.net
 
Old 11-13-2010, 08:26 PM
Kamaraju S Kusumanchi
 
Default map '-' to '_' and '_' to '-'

Cameron Hutchison wrote:

> The X11 keysyms for these characters are "minus" and "underscore". If
> you run "xmodmap -pke | grep underscore" you should see which keycode has
> these keysyms mapped.
>
> For me, this is:
> $ xmodmap -pke | grep underscore
> keycode 20 = minus underscore minus underscore
>
> I suspect that's a standard keyboard keycode so you'll get the same
> results, but run it anyway to be sure.
>
> You can remap this like so:
> $ xmodmap -e "keycode 20 = underscore minus underscore minus"
>
> That swaps minus and underscore.

Yes. This works and it is just great. Is there a solution when the machine
does not run X?

thanks
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: ibmvp2$v9t$1@dough.gmane.org">http://lists.debian.org/ibmvp2$v9t$1@dough.gmane.org
 
Old 11-14-2010, 01:30 AM
Ron Johnson
 
Default map '-' to '_' and '_' to '-'

On 11/12/2010 02:38 PM, Mitchell Laks wrote:

On 03:02 Fri 12 Nov , Kamaraju S Kusumanchi wrote:

While working on my Debian box (which btw is a mix of Lenny and Squeeze), I
find that I type the underscore character ('_') more often than the dash
character ('-'). It could be file names, variable names while writing code
etc.,


i have noticed the same thing. now if we all programmed in lisp this would not be a problem


Or COBOL...


I considered switching to common lisp from perl and C and C++ for this reason




--
Seek truth from facts.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4CDF49CA.7070903@cox.net">http://lists.debian.org/4CDF49CA.7070903@cox.net
 
Old 11-14-2010, 09:00 AM
Cameron Hutchison
 
Default map '-' to '_' and '_' to '-'

Kamaraju S Kusumanchi <raju.mailinglists@gmail.com> writes:

>Yes. This works and it is just great. Is there a solution when the machine
>does not run X?

I don't know the specific incantations, but it should be possible with
loadkeys(1) from the console-tools package.

The man pages for dumpkeys(1) and keymaps(5) will probably be necessary
reading.

From: Cameron Hutchison <lists@xdna.net>
Newsgroups: gmane.linux.debian.user
Subject: Re: map '-' to '_' and '_' to '-'
References: <ibis8b$4dc$1@dough.gmane.org> <20101112133310.GA26052@aurora.owens.net> <5b5d.4cddb78d.c66fd@getafix.xdna.net> <ibmvp2$v9t$1@dough.gmane.org>

Kamaraju S Kusumanchi <raju.mailinglists@gmail.com> writes:

>Yes. This works and it is just great. Is there a solution when the machine
>does not run X?

I don't know the specific incantations, but it should be possible with
loadkeys(1) from the console-tools package.

The man pages for dumpkeys(1) and keymaps(5) will probably be necessary
reading.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 400d.4cdfb349.523c7@getafix.xdna.net">http://lists.debian.org/400d.4cdfb349.523c7@getafix.xdna.net
 

Thread Tools




All times are GMT. The time now is 02:54 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org