Atom Editor键映射是否支持功能键?(Does the Atom Editor keymap support function keys? Like F5)

我用这个条目设置了keymap.cson 。 在调色板中,我可以看到F5与此命令相关联,但按F5不会触发它

'.workspace .editor': 'F5': 'runner:run'

I setup keymap.cson with this entry. In the palette, I can see F5 is associated with this command but pressing F5 does not trigger it

'.workspace .editor': 'F5': 'runner:run'

最满意答案

是的,Atom支持功能键。 键的名称区分大小写, F5的名称为f5 ,请注意小写“f”。 以下应该有效:

'atom-workspace atom-text-editor': 'f5': 'runner:run'

另外,请注意,您可能希望将atom-workspace atom-text-editor替换为atom-workspace ,除非您在Tree View,Markdown Preview或任何其他内容时不希望键执行命令。查看不是编辑器。

Yes, Atom supports function keys. The names of the keys are case-sensitive and the name of F5 is f5, note the lowercase "f". The following should work:

'atom-workspace atom-text-editor': 'f5': 'runner:run'

Also, note that you may want to replace atom-workspace atom-text-editor with just atom-workspace, unless you don't want the key to execute the command when you're on the Tree View, a Markdown Preview or any other view that isn't an editor.

Atom Editor键映射是否支持功能键?(Does the Atom Editor keymap support function keys? Like F5)

我用这个条目设置了keymap.cson 。 在调色板中,我可以看到F5与此命令相关联,但按F5不会触发它

'.workspace .editor': 'F5': 'runner:run'

I setup keymap.cson with this entry. In the palette, I can see F5 is associated with this command but pressing F5 does not trigger it

'.workspace .editor': 'F5': 'runner:run'

最满意答案

是的,Atom支持功能键。 键的名称区分大小写, F5的名称为f5 ,请注意小写“f”。 以下应该有效:

'atom-workspace atom-text-editor': 'f5': 'runner:run'

另外,请注意,您可能希望将atom-workspace atom-text-editor替换为atom-workspace ,除非您在Tree View,Markdown Preview或任何其他内容时不希望键执行命令。查看不是编辑器。

Yes, Atom supports function keys. The names of the keys are case-sensitive and the name of F5 is f5, note the lowercase "f". The following should work:

'atom-workspace atom-text-editor': 'f5': 'runner:run'

Also, note that you may want to replace atom-workspace atom-text-editor with just atom-workspace, unless you don't want the key to execute the command when you're on the Tree View, a Markdown Preview or any other view that isn't an editor.