Git Product home page Git Product logo

atom-keymap's Introduction

Atom

Build status

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

Atom is a hackable text editor for the 21st century, built on Electron, and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.

Atom

Atom Screenshot

Visit atom.io to learn more or visit the Atom forum.

Follow @AtomEditor on Twitter for important announcements.

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Documentation

If you want to read about using Atom or developing packages in Atom, the Atom Flight Manual is free and available online. You can find the source to the manual in atom/flight-manual.atom.io.

The API reference for developing packages is also documented on Atom.io.

Installing

Prerequisites

macOS

Download the latest Atom release.

Atom will automatically update when a new release is available.

Windows

Download the latest Atom installer. AtomSetup.exe is 32-bit. For 64-bit systems, download AtomSetup-x64.exe.

Atom will automatically update when a new release is available.

You can also download atom-windows.zip (32-bit) or atom-x64-windows.zip (64-bit) from the releases page. The .zip version will not automatically update.

Using Chocolatey? Run cinst Atom to install the latest version of Atom.

Linux

Atom is only available for 64-bit Linux systems.

Configure your distribution's package manager to install and update Atom by following the Linux installation instructions in the Flight Manual. You will also find instructions on how to install Atom's official Linux packages without using a package repository, though you will not get automatic updates after installing Atom this way.

Archive extraction

An archive is available for people who don't want to install atom as root.

This version enables you to install multiple Atom versions in parallel. It has been built on Ubuntu 64-bit, but should be compatible with other Linux distributions.

  1. Install dependencies (on Ubuntu):
sudo apt install git libasound2 libcurl4 libgbm1 libgcrypt20 libgtk-3-0 libnotify4 libnss3 libglib2.0-bin xdg-utils libx11-xcb1 libxcb-dri3-0 libxss1 libxtst6 libxkbfile1
  1. Download atom-amd64.tar.gz from the Atom releases page.
  2. Run tar xf atom-amd64.tar.gz in the directory where you want to extract the Atom folder.
  3. Launch Atom using the installed atom command from the newly extracted directory.

The Linux version does not currently automatically update so you will need to repeat these steps to upgrade to future releases.

Building

Discussion

License

MIT

When using the Atom or other GitHub logos, be sure to follow the GitHub logo guidelines.

atom-keymap's People

Contributors

50wliu avatar as-cii avatar ben3eee avatar benogle avatar bolinfest avatar damieng avatar darangi avatar daviwil avatar deedeeg avatar dependabot[bot] avatar donmccurdy avatar iolsen avatar izuzak avatar jasonrudolph avatar kevinnathan avatar kevinsawicki avatar lee-dohm avatar matthewwithanm avatar maxbrunsfeld avatar mnquintana avatar noseglid avatar peterdavehello avatar sadick254 avatar sergiopvilar avatar smashwilson avatar t9md avatar tmunro avatar torn4dom4n avatar wvanlint avatar zcbenz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-keymap's Issues

OS X's Dvorak-Qwerty mode does not work.

See atom+dvorak discussion in the forums.

For developers who type with the Dvorak keyboard layout, universal shortcuts like Cmd+C require two hands, which wastes time. As a result, most OS X users who type with Dvorak use the operating system's built-in "Dvorak Qwerty" mode, which automatically reverts to Qwerty when keys like Cmd or Ctrl are pressed, so that we can use the same hotkeys as everyone else.

Unfortunately, this doesn't seem to work in Atom – with Cmd pressed, the keys still map to their Dvorak equivalents. This is a common problem in Java-based IDEs (Eclipse, Netbeans, PHPStorm, ... ) and is one reason I've stuck with Sublime Text – which does not have this issue – for so long. Interestingly, I have never found an application in the App Store with the problem, so I would assume it has something to do with how key events are read from the operating system (Atom should not, in theory, need to know anything about my chosen keyboard layout).

You can try this mode on any Mac:

screenshot

The only workaround I know of would be for me to manually override every hotkey of every plugin, which isn't really up there on my bucket list. I'd be happy to help implement a fix or test this, but at the moment I really don't know where to start.

Thanks!

uncaughtException: Set is not defined

I installed atom-keymap in a test app using apm (apm 0.51.0 - npm 1.4.4 - node 0.10.26) - when I then try to run the test app using atom-shell (which says it is using node.js v0.11.10 and atom-shell 0.12.3.) I get the exception at the bottom. I tried many different things to get it to work, but nothing did it for me.. Is this a known problem?

ReferenceError: Set is not defined
    at Object.<anonymous> (/Users/username/app/node_modules/atom-keymap/lib/helpers.js:8:23)
    at Object.<anonymous> (/Users/username/app/node_modules/atom-keymap/lib/helpers.js:275:4)
    at Module._compile (module.js:455:26)
    at Object.Module._extensions..js (module.js:473:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:363:17)
    at require (module.js:379:17)
    at Object.<anonymous> (/Users/username/app/node_modules/atom-keymap/lib/key-binding.js:6:26)
    at Object.<anonymous> (/Users/username/app/node_modules/atom-keymap/lib/key-binding.js:57:4)

Ctrl+Shift+7 Not working well

For some releases now the keybinding Ctrl+Shift+7 in a qwerty pt_PT (no dead keys) layout is not working correctly.

Operating System: Ubuntu 14.04

Expected key: Ctrl+/
Real Keybinding: Ctrl+?

(when using Ctrl+. to debug)

Bottom line, I think it is mapped to the wrong key.

Keymap Is Not Reloaded If keymap.cson Consists Solely Of Comments

Suppose I define the following in my keymap.json file:

'atom-text-editor:not(mini).autocomplete-active':
  'tab': 'unset!'
  'enter': 'autocomplete-plus:confirm'
  'up': 'unset!'
  'down': 'unset!'
  'ctrl-p': 'autocomplete-plus:select-previous'
  'ctrl-n': 'autocomplete-plus:select-next'

And then I decide that I don't want to do that, so I comment it all out:

# 'atom-text-editor:not(mini).autocomplete-active':
#   'tab': 'unset!'
#   'enter': 'autocomplete-plus:confirm'
#   'up': 'unset!'
#   'down': 'unset!'
#   'ctrl-p': 'autocomplete-plus:select-previous'
#   'ctrl-n': 'autocomplete-plus:select-next'

If I have no other cson content, then I believe (according to

readKeymap: (filePath, suppressErrors) ->
if suppressErrors
try
CSON.readFileSync(filePath)
catch error
console.warn("Failed to reload key bindings file: #{filePath}", error.stack ? error)
@emitter.emit 'did-fail-to-read-file', error
undefined
else
CSON.readFileSync(filePath)
) the keymap won't actually get reloaded.

I.e. If i only have one definition in my keymap and I wish to unset it by commenting it out, I have to quit and relaunch Atom.

If a keymap file cannot be loaded, atom should still invalidate any prior keymap associated with that file.

need to press ":" twice in order to see it appear

When i press ":" the first time nothing happens. But when I type it one more time the ":'" appears.

Note: I do not use a default US layout. To Type characters like {}():;<>[] I use the capslock key plus a normal letter. All those mappings work fine with atom, except of the ":" which is mapped to Capslok + g (g = key code 0x29)

Mapping prefixed keys with 'unset!' continues to delay the prefix key command

As discussed here: http://discuss.atom.io/t/ctrl-k-as-prefix-key-linux/9553

This simple example causes this bug and is only tested on Linux (0.96.0-7410f9a).

'.workspace .editor:not(.mini)':
  'ctrl-u': 'editor:move-to-beginning-of-line'
  'ctrl-u j': 'editor:move-to-end-of-line'
  'ctrl-u j': 'unset!'

Here Ctrl-u waits for Ctrl-u j to happen although it's unset. Ctrl-u j does nothing as intended, but the prefix key still waits for it to trigger.

Hitting Ctrl-u here should not cause a delay.

Atom won't open - Changed win32.json

So I wanted to change my hotkeys so it doesn't conflict with typing [ by changing the win32.json. (like here)
Which worked the first time I did it. Then somehow I couldn't type [ anymore so I tried it again. The entry "ctrl-alt-]": "editor:unfold-current-row", reappeared in the win32.json file. I removed it.

Now when I try to open Atom I am greeted by this screen instead of the usual Atom editor.
atomeditorstartuperror
Clicking on the link on the bottom highlights the selected part.

I checked the index.js but don't see anything wrong. I immediately looked at win32.json since that is the file that I changed but also don't see anything wrong. I let it run through a JSON verifyer which also doesn't mention any problems.
I also looked at cson.js, which looks fine to me. I never modified cson.js.
Here's a gist of the mentioned files.

If anyone knows what file to fix or how to solve this problem, your help is very appreciated.
Thanks!

Cmd+Alt+\ does not seem to be recognized properly

See related Discuss thread: http://discuss.atom.io/t/toggle-soft-wrap-key-binding/2643/3?u=leedohm

Repro Steps

  1. Launch Atom
  2. Open Keybinding Resolver Cmd+.
  3. Hold down the Command and Alt keys
  4. Observe that the Keybinding Resolver shows alt-cmd as expected
  5. While continuing to hold down the Command and Alt keys, press the backslash key </kbd>

Expected: Keybinding Resolver shows alt-cmd-\ like when it displays any other key chord, even if it is not tied to a command
Actual: Keybinding Resolver shows cmd

Overriding keybindings

Currently it is not possible to override keybindings, instead you add additional keybindings for a package's keybindings in your own keymap definitions.

For example:
It is a really pain when you are using Git-Diff with the Swiss-German (French, etc) keyboard layout because "alt-g" is mapped to "@". The issue is that you always have to type "alt-g" twice to get the "@" and this is not really usable IMHO: atom/git-diff#15

Keybinding targetting node inside a shadow DOM

I'm not sure whether this is a bug or a limitation of shadom DOM but I can't find a way to trigger a command on an element in a shadow root.

Here's my use case: I have a custom element to edit a table, which use a shadow DOM for its content, I also have an atom-text-editor element used for editing the cell's content that is contained inside the shadow root (seems like the only way to make it render properly). I would like to remap some editor's commands to make it feel more natural for users (the editor is multiline but enter should trigger a confirmation, and ctrl-enter a new line insertion for instance).
It turns out that using the following keymap doesn't trigger the expected command on the text editor element:

'atom-table-editor::shadow atom-text-editor':
  'enter': 'core:confirm'
  'ctrl-enter': 'editor:newline'

Is there a way to workaround this issue?
Is it something that can be workaround?

I haven't looked at the keymap implementation in detail, but if it use the matches method I can say that it doesn't reach nodes inside a shadow root.

Here's a sample of a test in the console that demonstrates that matches doesn't work with shadow root:

> e = atom.views.getView(atom.workspace.getActiveTextEditor())
<atom-text-editor class=​"editor" tabindex=​"-1" callattachhooks=​"true" data-grammar=​"source coffee" data-encoding=​"utf8">​…​</atom-text-editor>​
> g = e.shadowRoot.querySelector('.indent-guide')
<span class=​"leading-whitespace indent-guide invisible-character">​··​</span>​
> g.matches('atom-text-editor::shadow .indent-guide')
false
> g.matches('.indent-guide')
true

What approach would you consider for this use case?

FWIW the code of the original space-pen version can be found here: https://github.com/abe33/atom-table-edit/blob/master/lib/table-view.coffee#L761-L777
And the WIP version using custom element is there: https://github.com/abe33/atom-table-edit/blob/master/lib/table-view.coffee#L761-L777

Keymaps don't follow specificity rules

If the active element is an Editor View, keys bound to .editor will be chosen over the those bound to .workspace .pane even though .workspace .pane has a higher specificity and

[Feature Request] Unindent keybind

Either I'm blind or there is no keybind to unindent a line in Atom like there is in for example Sublime. Would be nice if that could be added :)

Mac: `control+up` setting for mission control

  1. Using Atom Version 0.79.0 (0.79.0)
  2. I set my settings like this:
    screenshot 2014-03-29 14 38 11
    Where mission control activates with control+up
  3. Keyboard shortcut for Add Selection Above in Atom is control+shift+up.
  4. Expected behavior: Atom's shortcut takes precedence
    What I got: mission control activates and plays in slow motion (when you hold shift + some native animation it plays in slow motion).
  5. Note: Keybinding resolver reads: ctrl-shift-shift when it should read ctrl-shift-up

There might not be a way around this. The solution I came up with was just to change the binding for mission control to f4, as I do not use it much anyway.

Unsetting a key doesn't appear to work with complex selector

Ref: atom/markdown-preview#114

I was experimenting with my keybindings to unmap the default Markdown Preview key:

'atom-workspace, atom-workspace atom-text-editor':
  'ctrl-shift-M': 'markdown-preview:toggle'

and set a new, grammar-scoped key:

'atom-text-editor[data-grammar="source gfm"]':
  'ctrl-shift-M': 'markdown-preview:toggle'

So I added the following to my keymap.cson:

'atom-workspace, atom-workspace atom-text-editor':
  'ctrl-shift-M': 'unset!'
'atom-text-editor[data-grammar="source gfm"]':
  'ctrl-shift-m': 'markdown-preview:toggle'

which, in theory, should make it so that Ctrl+Shift+M should only activate the Markdown Preview when a GFM text editor is focused. But if I do the following:

  1. With the keymap modification above active, open a Markdown file
  2. Focus the tree view
  3. Press Ctrl+Shift+M

Expected: Markdown Preview is not displayed
Actual: Markdown Preview is displayed

Here's what I see in the Keybinding Resolver:

screen shot 2015-05-11 at 8 21 40 am

Selector grouping might cause confusion because of how specificity is calculated

(This issue is derived from atom/settings-view#124.)

The keymap package determines which keystroke will be matched in the following way:

To match a keystroke sequence, the keymap starts at the target element for the keyboard event. It looks for key bindings associated with selectors that match the target element. If multiple match, the most specific is selected. If there is a tie in specificity, the most recently added binding wins.

However, selectors which use selector grouping (multiple selectors separated with a ,) might cause confusion due to the way specificity is calculated. Specificity is calculated based on the first selector in the group:

{specificity} = require 'clear-cut'

specificity('.workspace, .workspace .editor:not(.mini)') # 10
specificity('.workspace .editor:not(.mini), .workspace') # 30

For this reason, the order of selectors in the group plays an important role when matching keystrokes.

In order to prevent users from getting trolled by this, it might be helpful to treat selectors which use selector grouping in a special way (currently, all selectors are treated equally).

An option that comes to mind is to detect selector groups, and split such keybindings into multiple keybindings, one for each selector in the group. For example, a keybinding which binds cmd-[ to .workspace .editor:not(.mini), .workspace would be split into two keybindings:

  • cmd-[ bound to .workspace (specificity 10)
  • cmd-[ bound to .workspace .editor:not(.mini) (specificity 30)

As a result, in elements matched by .workspace .editor:not(.mini), the specificity used for cmd-[ would be 30, and not 10 (which what is being used now).

cc @nathansobo @kevinsawicki

Comment shortcut does not work with Mac's Dvorak - Qwerty ⌘ mode

I use Mac's Dvorak - Qwerty ⌘ mode for my keyboard layout. Recently, Atom gained full support for this keyboard layout (yay!), but I found one shortcut not working...

When I try to comment something out in a CSS or JS file by using the + / shortcut, nothing happens. All other shortcuts that I use work, including copy, paste, command palette, find, etc. All of them use the ⌘ key and they work.

I tried to disable my 3rd party packages, but it still didn't work.

I checked my keybindings, and commenting is indeed set to + /.

I have no custom keybindings.

Changing my keyboard layout to US allows me to use the shortcut, so I know is has something to do with the Dvorak - Qwerty ⌘ mode.

Yosemite 10.10
Atom 0.145.0

Ctrl-k and Ctrl-y don't work as expected (not emacs-compatible)

Mac OS X 10.9.2

Ctrl-k is mapped to editor:cut-to-end-of-line, which works correctly, but performing Ctrl-k multiple times leads to only the last line killed to be stored in the clipboard.

Ctrl-y isn't mapped to anything, but emacs users would expect it to be default mapped paste.

Key / is not recognized by key mapper

Using 0.139.0 on macos. When i do cmd+/ in the key binding resolver.
The command is not shown as it does for other keys.

I'm using french canadian layout

Handle the Windows Key

I would love to bind some actions on the windows key, but apparently, it does not resolve right now.

Key Binding Resolver will show "win" when i press the windows key, but once it Try something like win-A, it will display just "a".

Uncaught TypeError: Cannot read property 'length' of undefined

c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:387
Hide Stack Trace
TypeError: Cannot read property 'length' of undefined
  at TextBuffer.module.exports.TextBuffer.lineLengthForRow (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:387:29)
  at TextBuffer.module.exports.TextBuffer.clipPosition (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:939:53)
  at DisplayBuffer.module.exports.DisplayBuffer.screenPositionForBufferPosition (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\src\display-buffer.js:1009:27)
  at DisplayBuffer.module.exports.DisplayBuffer.scrollToBufferPosition (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\src\display-buffer.js:661:47)
  at TextEditor.module.exports.TextEditor.scrollToBufferPosition (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\src\text-editor.js:2631:33)
  at GoToLineView.module.exports.GoToLineView.confirm (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\go-to-line\lib\go-to-line-view.js:116:14)
  at atom-text-editor.<anonymous> (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\go-to-line\lib\go-to-line-view.js:55:24)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\src\command-registry.js:243:29)
  at c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\src\command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (c:\Users\Michael J. Calkins\AppData\Local\atom\app-0.166.0\resources\app\src\window-event-handler.js:167:20)

Windows 7
I pushed Ctrl + T and then Ctrl + Shift + T can't reproduce yet.
Then the red window to create the issue came up and my editor worked fine again.

Skip timeout for native key bindings

0.74 introduced the following feature:

The keymap now waits for a timeout when a keystroke sequence exactly matches one key binding and partially matches others.

While useful in some situations, it's no good for native key bindings. Here's an example:

The Swiss German keyboard features the "@" character on "alt-g". Atom uses this key binding as a shortcut to git commands e.g. "alt-g b". In order to get the "@" character back (yep, it's kinda important for coding), I've added the following to my keymap:

# Reclaim the @ character on Swiss German keyboards.
'.platform-darwin':
  'alt-g': 'native!'

This worked fine up until 0.73, but since 0.74 I have to hit "alt-g" several times to type just one "@" character. I assume it has to do with the timeout.

Suggested solution: A native key binding like "alt-g" should implicitly disable any sub-bindings like "alt-g b" and skip any timeouts.

Glob matching

@mcolyer wishes he had a way to do some basic globbing:

".vim-mode":
  '" [a-zA-Z]': "vim-mode:register-prefix"

This syntax would restrict the possible keys entered without needing to exhaustively listing them. If it's easier maybe it could just accept regexps here rather than trying to create a subset?

Note: This is also required for f and t motions.

Shortcut labels not updating

I installed a package and I wanted to swap the keymapping.

When I open the command palette, the shortcut labels still show up as if the bindings are still applied

shortcut

Could not bind `alt-n`

Basically, I am trying to bind alt-n to editor:move-line-down, after I save my settings, the new keybinding doesn't work(only output a letter).

Thanks

Bundled prefixed keys bindings delay even if 'unset!' by user keymap

This affects keybindings like cmd-k, where cmd-k is the prefix of many keybindings that come bundled with Atom. Hitting cmd-k has a delay even if every single one of these keybindings are unset! in the user key map.

Doing some debugging, in the dev tools. What appears to be happening is this...

Putting a breakpoint on line 440 of keymap-manager.js (where partial matches are found)...
screen shot 2015-04-21 at 9 30 58 pm
... and hitting cmd-k to hit our breakpoint, we see that the partialMatchCandidates array being filtered will iterate over the bundled keymap bindings BEFORE the user bindings. The console in the screenshot above, shows the source of all the keybindings of partialMatchCandidates. As you can all the bindings from /Application/Atom.app/* are at the top, while the user bindings from /Users/* are on the bottom. This ordering allows line 444 of keymap-manager.js to be reached, which incorrectly identifies it as a partialMatch even though a user specified keymap binding has it unset!.

A naive fix that simply reverses the order of partialMatchCandidates (process bundled bindings AFTER user bindings)...
screen shot 2015-04-21 at 9 39 43 pm
...correctly yields an empty partialMatches as all user bindings are added to the ignoreKeystrokes set and all the bundled key bindings are then ignored.

@stmichael mentioned this behavior on a different issue #49

Overriding keybindings doesn't work

Similar to #9 but the solution there doesn't seem to work for me.

My keymap.cson:

'.platform-darwin .editor':
  'cmd-d': 'unset!'

'atom-text-editor:not(.mini)':
  'cmd-d': 'editor:delete-line'

There are now 3 cmd-d Keybindings, but pressing it doesn't do anything (because I unset it?). What am I supposed to do to remove the default keybinding and use it for editor:delete-line instead?

ctrl+c (copy) on linux

I am using arch linux with subtle as my window-manager. ctrl+c does not copy text for me, but ctrl+x works just fine.

Can you give my any tips on how to debug this further?

Numpad keys on are not appropriately handled

When using the numpad, the keyCodes do not match the ascii numbers or symbols

On my machine (windows 7)
0 - 9 have the keycodes: 96-105 where it should be 48-57
All the symbols have bad mappings as well:

key expected actual
/ 47 111
* 42 106
- 45 109
+ 43 107
. 46 110

The shifted variants will also need to be translated.

It appears it's pretty easy to determine when a numpad key was pressed:

if event.location is 3
   keyCode = numpadToASCII(event.keyCode)

I guess the only thing I need to know to fix this is if we want to identify these numbers/symbols separately than from the regular numbers/symbols.

I.e.

  • pressing numpad 4 would result in something like 'NUM-4'
  • pressing numpad . would result in 'NUM-.'

Where regular '4' and '.' would just be '4' and '.', respectively.

Cannot bind cmd-tab on OSX

'.platform-darwin':
'cmd-tab': 'tree-view:toggle'

cmd-tab (under any selector), does not seem to set the command. I actually want to just unset it, because atom is getting the command and inserting an  unknown character box type thing. it does this for some other commands as well (ctrl-alt-left, for example), but those commands are not ones I use. Any workaround or hack is welcome, I just need it to stop doing this if I am going to be able to use atom.

Remove number pad support?

Currently number pad keys are generated with a num- prefix to distinguish whether the key was pressed on the main keyboard or the number pad section.

This gives people more precision in their keybindings but comes at a cost, if an Atom package adds a ctrl-left keybinding and a person presses ctrl and 4 on the number pad with NumLock enabled, the key maps to ctrl-num-left and that package's command isn't triggered. People seem to be expecting number pad keys with num lock pressed to behave without distinction from their non-number pad equivalents as evidenced in atom/atom#2931

This affect any keybindings that use Home, End, PageUp, PageDown, Enter, +, -, /, *, left, right, up, and down. They all require keybindings for their command with the num- modified to target this case.

It seems like a burden on package authors to even force them to consider the number pad and num lock when coming up with keybindings.

Some options:

  • Retry the keystroke without the num- modifier if no matches with the num- modifier exist.
  • Remove support for the num- modified completely.
  • Something else?

/cc @nathansobo and @jacobgardner

npm install build failed

KATzilla@cidevant ~/Code/JavaScript/Atom.io/atom-keymap-official [master] $ npm install
npm WARN engine [email protected]: wanted: {"node":"~0.8.x"} (current: {"node":"0.10.28","npm":"2.0.1"})

> [email protected] install /Users/cidevant/Code/JavaScript/Atom.io/atom-keymap-official/node_modules/keyboard-layout
> node-gyp rebuild

  CXX(target) Release/obj.target/keyboard-layout-observer/src/keyboard-layout-observer-mac.o
../src/keyboard-layout-observer-mac.mm:42:3: error: no matching function for call to 'uv_async_init'
  uv_async_init(loop, &async, asyncSendHandler);
  ^~~~~~~~~~~~~
/Users/cidevant/.node-gyp/0.10.28/deps/uv/include/uv.h:1192:15: note: candidate function not viable: no known conversion from
      'void (uv_async_t *)' to 'uv_async_cb' (aka 'void (*)(uv_async_t *, int)') for 3rd argument
UV_EXTERN int uv_async_init(uv_loop_t*, uv_async_t* async,
              ^
1 error generated.
make: *** [Release/obj.target/keyboard-layout-observer/src/keyboard-layout-observer-mac.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/cidevant/Code/JavaScript/Atom.io/atom-keymap-official/node_modules/keyboard-layout
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok

> [email protected] install /Users/cidevant/Code/JavaScript/Atom.io/atom-keymap-official/node_modules/pathwatcher/node_modules/runas
> node-gyp rebuild

  CXX(target) Release/obj.target/runas/src/main.o
  CXX(target) Release/obj.target/runas/src/runas_darwin.o
  CXX(target) Release/obj.target/runas/src/fork.o
  SOLINK_MODULE(target) Release/runas.node
  SOLINK_MODULE(target) Release/runas.node: Finished

> [email protected] install /Users/cidevant/Code/JavaScript/Atom.io/atom-keymap-official/node_modules/grunt-coffeelint/node_modules/coffeelint
> [ -e lib/commandline.js ] || npm run compile


> [email protected] install /Users/cidevant/Code/JavaScript/Atom.io/atom-keymap-official/node_modules/pathwatcher
> node-gyp rebuild

  CXX(target) Release/obj.target/pathwatcher/src/main.o
  CXX(target) Release/obj.target/pathwatcher/src/common.o
  CXX(target) Release/obj.target/pathwatcher/src/handle_map.o
  CXX(target) Release/obj.target/pathwatcher/src/pathwatcher_mac.o
  SOLINK_MODULE(target) Release/pathwatcher.node
  SOLINK_MODULE(target) Release/pathwatcher.node: Finished
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.28
npm ERR! npm  v2.0.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the keyboard-layout package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls keyboard-layout
npm ERR! There is likely additional logging output above.

Multi-keystroke patterns can't be created solely out of modifier keys. (like 'shift shift')

It's hard to tell if this is by design or not, but I wanted to make a double tap of the shift key open the autocomplete menu. This approach works for doubled special keys and character literals, so I expected it to work for modifiers too.

Doesn't work:

'.editor':
  'shift shift': 'command-palette:toggle'

Does work:

'.editor':
  'escape escape': 'command-palette:toggle'
'.editor':
  'x x': 'command-palette:toggle'

(I toggled the command palette in these examples but the same applies for autocomplete, etc.)

Is this broken or by design? And if it's by design, why?

Thanks! 🐹

Cannot override cmd+l

cmd-l seems to be hardcoded to "editor:select-line", I wanted to bind it to "go-to-line:toggle". The only way for me to override it, is to delete the binding in Atom.app/Contents/Resources/app/keymaps/darwin.json, is there a way for me to force it to unbind the default bindings?

Delete key not working since 0.20 on Linux

Using the Delete key (both in the Numpad and Delete key) does not work.

Using Portuguese QWERTY Layout on Ubuntu 14.04

Originally reported here: atom/atom#2323

Aditional Information:

When using ctrl-. I'm getting:

Key Binding Resolver: .

screenshot from 2014-05-21 02 32 21

Tracked the problem in atom to: e29185e where atom-keymap dependency was changed to 0.20 in package.json

If I revert the current value (0.21) to 0.19 and rebuild it will solve the problem temporarily until atom-keymap 0.21 is fixed.

Keybind resolves wrong characters for ABNT2

Hi,

I'm using an ABNT2 keyboard (Brazilian)

abnt2 keyboard

the following is resolved wrongly:
ç -> ;
Ç -> :
" -> ~
' -> `
] ->
} -> |

I can see this in the keybind resolver ctrl+.
keybind resolver

How can I configure my keyboard correctly? If a patch is need, I gladly would do if someone give me some pointers.

Thanks!

Allow chords

There's some discussion in atom/vim-mode#221 about allowing bindings based on multiple keys being smashed simultaneously. This is pretty tricky, because if we detected a keydown for a key involved in a chord, we'd need to wait for a keyup before we could be sure the chord wasn't being triggered. Not a super high priority right now, but worth implementing in the future.

Direct bindings should override prefixes?

There are a bunch of "ctrl-k .." bindings on Windows and Linux, but I want to bind ctrl-k to a delete-to-eol type of command (like bash or emacs). I would expect this binding to disable any prefixes. Otherwise I would have to track down every combination and set to them "unset!" or something.

Using umlauts in keymaps

'body':
  'cmd-ä': 'pane:show-next-item'

'body':
  'cmd-ö': 'pane:show-previous-item'

cmd-ä is ignored while cmd-ö correctly triggers show-previous-pane. It appears ä and ö are treated as the same keys.

Atom 0.103.0, Mac OS 10.9.3.

Special case certain keyIdentifier values on Windows

It seems that #10 affects Windows as well as Linux.

ctrl-[ binding wasn't functioning in vim-mode so I stuck a console.log on the keystroke and found it wasn't correct.
Manually editing charCodeFromHexCharCode and allowing Windows to use the same fix as Linux fixed the issue.

I haven't got time to create a pr right now, but will try and do one next week if no one else gets there first.

Cross-platform keybinding

It seems like it would make sense for Atom to be able to swap between the keys ctrl and cmd based on the OS it is running since it already knows this. This would allow one key string to match to either ctrl or cmd instead of having to specify them separately.

Possible to [temporarily] disable keybindings?

I'm writing a plugin that opens an iframe. The iframe requires user interaction, however, keybindings like ctrl+c, ctrl+v, ctrl+a, etc. are bubbled up and handled by Atom instead of the iframe (which has the requisite focus). Is there any way to temporarily disable handling of certain keybindings (like those aforementioned) ... or perhaps an alternative?

thanks in advance

Some non-US keyboard layouts not working

Regarding: atom/atom#2600
@kevinsawicki

Compare US and (for example)
800px-kb_us-international svg

German keyboard layout
800px-kb_germany svg

I think its easy to see why src/helpers.coffee is destined to fail horribly.

One example to demonstrate: I try to Toggle comments using Ctrl-/. For that I would have to press Ctrl-Shift-7 as you can see above. It registers Ctrl-?.

I don't know how, but your script somehow catches my Ctrl-Shift-7 (which would be shift+55) and makes it an ? (191) where it should make it an &.

Edit: What is that; If I press # on my keyboard it gets resolved to 3 in the keybinding resolver, but inserted correctly into the text. Something is very very wrong here! 😱

Shift keyevent interrupts matching a key sequence

Investigating a vim-mode bug about bindings like 'i (' and 'i {' being ignored, I found the following: pressing shift alone generates a keydown event. Thus, when typing a sequence like 'i (', the 'i' gives a partial match. Then, on my keyboard, typing '(' involves pressing shift and 9 simultaneously. The shift key alone, however, generates a separate keydown event before the 9 keypress, so the partial matching gets interrupted before the actual '(' keydown event comes in. I verified this by console.logging the keydown events received on Chromium 39, Linux.

EDIT: this can be also verified by having vim-mode on, looking at the keybinding resolver. In command mode, press first 'c', then 'i'. There's the list of partial matches. As soon as I push down the shift key to type '(', the list of partial matches disappears before I could type in the actual '('.

EDIT 2: This might be Linux specific.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.