The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

Temporarely disable key capture

asked 2013-10-15 14:28:22 +0000

teto gravatar image

Hi,

I would like to disable i3 key bindings via an i3 shortcut. I would then enter a shortcut ignored by i3 and treated by the next application (in my case Sublimetext). i3 would then resume keyboard shortcuts interpretation. It would help when i3 shortcuts overlap those of other applications. I wish I could choose the same shortcuts for i3 than for applications when the actions have the same meaning

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2013-10-15 15:09:04 +0000

BatmanAoD gravatar image

You could create a mode with only one keybinding (the one to exit the mode). Look at the "resizing config" section of the user's guide (I'd link to it but I have no karma).

However, if your i3 bindings conflict with a program you use with any regularity, you should reconfigure them to avoid that conflict. I don't believe that any i3 bindings are hardcoded, so you should be able to set them up any way you'd like.

edit flag offensive delete link more

Comments

but I like keeping the same keybindings when they are logically the same. For instance ALT+1 goes to window 1 in irssi or workspace 1 in i3. I wish there would be a mode that resets to normal mode after a shortcut was pressed or after a certain timeout (2/3 seconds)

teto gravatar imageteto ( 2013-10-20 21:36:40 +0000 )edit

Personally, I think it makes more sense to think of reserving different modifier keys (or combinations of modifier keys) for different programs; that way keybindings with logically similar effects in different programs still won't conflict. For example, you could use ALT+1 in irssi and mod4+1 in i3.

BatmanAoD gravatar imageBatmanAoD ( 2013-10-21 16:34:12 +0000 )edit

That said, I suspect that both of your suggestions should be viable within your i3 config set-up, but I'm not completely sure of this. It seems that there should be a way to make `i3-msg` pop you out of the "do nothing" mode; if so, you can use `sleep` and `exec i3-msg` to do what you want.

BatmanAoD gravatar imageBatmanAoD ( 2013-10-21 16:36:12 +0000 )edit
0

answered 2013-10-22 10:37:28 +0000

Adaephon gravatar image

You could add something like this to your config:

mode "passthrough" {
    bindcode Mod4+9 mode "default"
}
bindcode Mod4+9 mode "passthrough"; exec sh -c 'sleep 2 && i3-msg mode "default"'

With Mod4+ESC you can enter and leave the passthrough mode and you have an automatic return to default mode after 2 seconds. i3 can call several commands separated by ';', but it does not wait for the completion of one command before starting the next. Therefore the workaround with sh. Also, you have to use '&&' as a simple ';' gets interpreted by the i3 configuration parser and essentially breaks the sh command.

If there are some cases, where you do not want the automatic return, you could always define an additional binding for just entering passthrough mode:

bindcode Mod4+Shift+9 mode "passthrough"
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-15 14:28:22 +0000

Seen: 508 times

Last updated: Oct 22 '13