zsh-users
 help / color / mirror / code / Atom feed
* Separating <tab> and <C-i>
@ 2006-06-25 20:17 Ligesh
  2006-06-25 21:17 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Ligesh @ 2006-06-25 20:17 UTC (permalink / raw)
  To: zsh-users


 I know historically <tab> was treated as <c-i> by terminal drivers, but is there a way to map these keys to different actions? I mapped <c-i> to history go up, but then <tab> was also mapped to the same.

 Thanks in advance.


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

* Re: Separating <tab> and <C-i>
  2006-06-25 20:17 Separating <tab> and <C-i> Ligesh
@ 2006-06-25 21:17 ` Bart Schaefer
  2006-06-26  7:24   ` Ligesh
       [not found]   ` <20060625223530.GA7971@lxlabs.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Bart Schaefer @ 2006-06-25 21:17 UTC (permalink / raw)
  To: zsh-users

On Jun 26,  1:47am, Ligesh wrote:
} 
}  I know historically <tab> was treated as <c-i> by terminal drivers

It has nothing to do with terminal drivers.  The definition of TAB in
the ASCII character set is code point decimal 9, which corresponds to
ctrl-I in the same way that backspace (8) is ctrl-H and newline (10)
is ctrl-J.

} but is there a way to map these keys to different actions?

Now *this* does have to do with terminal drivers, because you may be
able to use the terminal driver to remap the character value(s) sent
when you press a given key combination.  But that point pressing the
keys "Ctrl" and "I" will no longer be sending a true ctrl-I character,
and other applications may get confused.

You'll have to look at the documentation for your terminal or terminal
emulator (xterm, kterm, gnome-terminal, PuTTY, whatever) to find out
how to do that remapping.


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

* Re: Separating <tab> and <C-i>
  2006-06-25 21:17 ` Bart Schaefer
@ 2006-06-26  7:24   ` Ligesh
       [not found]   ` <20060625223530.GA7971@lxlabs.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Ligesh @ 2006-06-26  7:24 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

On Sun, Jun 25, 2006 at 02:17:15PM -0700, Bart Schaefer wrote:
> On Jun 26,  1:47am, Ligesh wrote:
> } 
> }  I know historically <tab> was treated as <c-i> by terminal drivers
> 
> It has nothing to do with terminal drivers.  The definition of TAB in
> the ASCII character set is code point decimal 9, which corresponds to
> ctrl-I in the same way that backspace (8) is ctrl-H and newline (10)
> is ctrl-J.

 Yeah, I forgot. But does that mean zsh is actually processing the ascii value of the key pressed? So zsh has no means to know whether it was <tab> or <c-i>?

> 
> } but is there a way to map these keys to different actions?
> 
> Now *this* does have to do with terminal drivers, because you may be
> able to use the terminal driver to remap the character value(s) sent
> when you press a given key combination.  But that point pressing the
> keys "Ctrl" and "I" will no longer be sending a true ctrl-I character,
> and other applications may get confused.

 I have xmodmap, but that will play havoc with my entire system, and I will have reconfigure screen, vim, elinks and I don't know what else. But I guess that's the only way out. I will have to make the terminal driver send a different keystroke for <c-j> and <c-i>, the two keys I want changed from their ascii meaning.

 Thanks



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

* Re: Separating <tab> and <C-i>
       [not found]   ` <20060625223530.GA7971@lxlabs.com>
@ 2006-06-27  2:46     ` Bart Schaefer
  2006-06-27  8:34       ` Ligesh
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2006-06-27  2:46 UTC (permalink / raw)
  To: zsh-users

On Jun 26,  4:05am, Ligesh wrote:
}
} [...] does that mean zsh is actually processing the
} ascii value of the key pressed? So zsh has no means to know whether it
} was <tab> or <c-i>?

Yes, and correct.  Although the window system knows the detailed state
of the keyboard, zsh is restricted to working with what it gets through
the TTY device, after the terminal emulator has done its thing.

} I have xmodmap, but that will play havoc with my entire system, [...]
} But I guess that's the only way out.

No, you can assign the mappings just within the terminal emulator (e.g.
xterm) by using appropriate X resources.  You may even be able to limit
the remappings to instances of the emulator that have been given a
specific window name.  Look at the documentation for the terminal progam
to see what resources it supports.


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

* Re: Separating <tab> and <C-i>
  2006-06-27  2:46     ` Bart Schaefer
@ 2006-06-27  8:34       ` Ligesh
  0 siblings, 0 replies; 5+ messages in thread
From: Ligesh @ 2006-06-27  8:34 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

On Mon, Jun 26, 2006 at 07:46:11PM -0700, Bart Schaefer wrote:
> On Jun 26,  4:05am, Ligesh wrote:
> }
> No, you can assign the mappings just within the terminal emulator (e.g.
> xterm) by using appropriate X resources.  You may even be able to limit
> the remappings to instances of the emulator that have been given a
> specific window name.  Look at the documentation for the terminal progam
> to see what resources it supports.

 Yup thanks again. That is "xterm*vt100: translations" in the xresource file. This is the easier way I guess, and it will only effect the console programs too. Anyway, I think I will have to now search how to rebind keys in gtk.

--
:: Ligesh :: http://ligesh.com 




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

end of thread, other threads:[~2006-06-27  8:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-25 20:17 Separating <tab> and <C-i> Ligesh
2006-06-25 21:17 ` Bart Schaefer
2006-06-26  7:24   ` Ligesh
     [not found]   ` <20060625223530.GA7971@lxlabs.com>
2006-06-27  2:46     ` Bart Schaefer
2006-06-27  8:34       ` Ligesh

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).