Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to map control keys #970

Closed
TheDerkus opened this issue Dec 14, 2016 · 9 comments
Closed

Unable to map control keys #970

TheDerkus opened this issue Dec 14, 2016 · 9 comments

Comments

@TheDerkus
Copy link

Running the command map global normal ^K : (where ^K is inserted literally, by typing control-v followed by control-k) does not raise an error, but has no effect.

Running the same command, but typing Enter instead of control-k, causes a strange box character to appear instead of the expected ^M. The command throws an error 1:1: 'map' wrong argument count

I was unable to find any help in the docs regarding mapping control characters and other such keys. If this is possible, how might I do it?

@lenormf
Copy link
Contributor

lenormf commented Dec 14, 2016

map global normal <c-k> ihello works for me, the ^X syntax has to be converted into <c-x>.

@TheDerkus
Copy link
Author

TheDerkus commented Dec 14, 2016

Strangely, using that method, I am able to map <c-k> and <c-x> successfully, but not <c-m>.

Edit: I also can't map <c-j>

@mawww
Copy link
Owner

mawww commented Dec 14, 2016

This is due to terminal input, and generate the same input, and as well. No easy fix for that, we could migrate to @leonerd's input system, but that would basically mean getting rid of ncurses, at least for input handling.

@leonerd
Copy link

leonerd commented Dec 15, 2016

@mawww You could become one of the early adopters of libtickit instead. It should provide you a superset of ncurses' features.

Currently sitting at an RC1 prerelease, but I'm hoping to call that a real 0.1 any day now:
http://www.leonerd.org.uk/code/libtickit/

@lenormf
Copy link
Contributor

lenormf commented Dec 15, 2016

If we're going to remove ncurses, I'd rather it's replaced by something that supports True Color.

@mawww
Copy link
Owner

mawww commented Dec 15, 2016

@leonerd is there a page that lists terminal emulators supporting the input model you proposed ?

@leonerd
Copy link

leonerd commented Dec 15, 2016

@lenormf Ahyes; I don't yet have truecolour support in libtickit, but adding is probably a couple of hours work at most. If you consider that your only blocker that should be easy enough to fix.

@lenormf
Copy link
Contributor

lenormf commented Dec 16, 2016

I created issue #1012 to discuss an eventual change, to keep this one clean.

@mawww
Copy link
Owner

mawww commented Dec 16, 2016

<c-m> and <c-i> are a general terminal input issue, closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants