Can I remap autocomplete hotkey(Ctrl+Space) to other?

2,309 views
Skip to first unread message

Lu Michael

unread,
Sep 24, 2013, 4:40:24 AM9/24/13
to ace-d...@googlegroups.com
Because Ctrl+Space is the default System hotkey for switching IME in Chinese Windows. So I want to remap it, is it possible?

Harutyun Amirjanyan

unread,
Sep 24, 2013, 5:30:50 AM9/24/13
to ace-d...@googlegroups.com
you can do
editor.commands.bindKey("some-key", "startAutocomplete")
editor.commands.bindKey("ctrl-space", null) // do nothing on ctrl-space

btw to which key do you want to remap it?
ace opens autocomplete popup on "Ctrl-Space|Ctrl-Shift-Space|Alt-Space"
https://github.com/ajaxorg/ace/blob/master/lib/ace/autocomplete.js#L278
are all of these unavailable on Chinese Windows.

Lu Michael

unread,
Sep 24, 2013, 8:18:17 PM9/24/13
to ace-d...@googlegroups.com
Ctrl-Shift-Space should be OK. Alt-Space is also occupied.

Fatima Grace Carillo

unread,
Oct 2, 2013, 10:56:28 PM10/2/13
to ace-d...@googlegroups.com
Hi,

How to do it if I want instead of ctrl-space autocomplete triggers everytime the user type in the keyboard. 

Harutyun Amirjanyan

unread,
Oct 3, 2013, 1:50:37 AM10/3/13
to ace-d...@googlegroups.com
Hi
you can use this

editor.commands.on("afterExec", function(e){
if (e.command.name == "insertstring"&&/^[\w.]$/.test(e.args)) {
editor.execCommand("startAutocomplete")
}
})

Morgan Yarbrough

unread,
Oct 5, 2013, 7:34:20 AM10/5/13
to ace-d...@googlegroups.com
I've been looking for this functionality and didn't know it existed. THANK YOU!!
Reply all
Reply to author
Forward
0 new messages