Commit Graph

24 Commits

Author SHA1 Message Date
Kevin Sawicki
ce71cf7703 Use correct indentation 2013-05-29 11:55:06 -07:00
Nathan Sobo
5e0dd80366 Remove overkill assertions 2013-04-26 15:34:48 -07:00
Nathan Sobo
7018f33ad7 Allow !important flag in keymap selectors 2013-04-05 14:52:35 -06:00
Corey Johnson & Nathan Sobo
5410e9368f Add ability to add/remove keymaps by name 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
9e8831f710 RootView.initialize no longer assigns window.rootView or calls open 2013-02-19 18:26:50 -07:00
Nathan Sobo
7f2747ead0 Make project a global and refactor startup process 2013-02-19 18:26:50 -07:00
Kevin Sawicki & Nathan Sobo
b2a9208acf Tab no longer transfers focus
The tab keystroke is now suppressed in keymap
if no bindings are triggered.

Closes #258
2013-02-12 17:29:14 -08:00
Nathan Sobo
1cab51cefa RootView can no longer be focused.
Allowing root view to be focused was stealing focus away from the
editor whenever a click event made it to the root view. This unnecessary
switching of focus was interfering with the ability to drag tabs.

But if RootView can't be focused, focus ends up being returned to the
document body when there are no focusable elements. This would be fine,
except for the fact that we frequently bind global events on root view,
and so they aren't triggered when events are triggered on the body. We
could just bind all global events on the body, but this would require
us to always attach elements to the DOM during specs, which is a serious
performance killer in specs.

The workaround is in the keymap. When the keymap handles a key event
that was triggered on the body, it triggers the corresponding semantic
event on the root view anyway, so from the event perspective, it's as
if the root view actually had focus. The only place this might fall
down is if someone wants to capture raw key events. But that's the
keymap's job anyway, and we maybe add a hook on the keymap if such a
need ever arises.
2013-02-08 17:33:37 -07:00
Nathan Sobo
2c211ba504 Remove ability to associate a binding set with a function
This was cool, but it's really hard to optimize the keymap with this feature because we never know if a keystroke will match against a binding set with a function, which will force us to always consider this binding set against every key event.
2012-11-02 13:39:21 -06:00
Corey Johnson & Nathan Sobo
9bf16063fc Un-F 2012-10-19 12:58:42 -06:00
Corey Johnson & Nathan Sobo
84b2cabeb3 Calling .abortKeyBinding on an event that wasn't triggered by the keymap is ok
Certain events call `abortKeyBinding` to opt out of handling certain keybindings. Snippets does this with tab for example. If it's not a situation where it's appropriate to go to the next tab stop, we let the next binding be triggered, which could insert a tab, for example. But when we trigger events from the event palette, there *is* no next binding. Having a no-op function helps in this situation.
2012-10-19 12:42:27 -06:00
Corey Johnson & Nathan Sobo
12b06ddf0c Get spec suite running (lots of failures) 2012-08-27 17:36:36 -05:00
Nathan Sobo
c2c8724ad0 Initial commit 2012-08-10 13:32:19 -06:00
Nathan Sobo
e1309f7c66 Key binding event handlers can call abortKeyBinding on the event object to abort and try the next binding 2012-06-20 22:08:16 -06:00
Nathan Sobo
171a19369a Fix remaining multi-keystroke specs 2012-06-18 17:31:26 -06:00
Nathan Sobo
85f695e4f1 Ensure that only whole keystrokes are matched in binding prefix matches 2012-06-18 17:31:11 -06:00
Nathan Sobo
d9dec3d974 Add spec confirming that multi-keystroke bindings can match against bindings in multiple binding sets
For example, if you have a very unspecific binding "ctrl-x ctrl-c", you can also have very specific "ctrl-x …" bindings, and bindings from both sets can be matched. A partial match in a more specific does not rule out later matches in a less specific set.
2012-06-18 17:05:52 -06:00
Nathan Sobo
9e5b4beeaa Add spec to confirm that an entering an unmatched keystroke sequence clears the queued keystrokes 2012-06-18 16:53:58 -06:00
Nathan Sobo
ac4aae2cec WIP: Begin introducing multi-keystroke bindings to Keymap 2012-06-18 16:46:39 -06:00
Corey Johnson
893564945e Add rootView.activeKeybindings().
This will return all active keybindings available for the focused element.
2012-05-29 15:46:38 -07:00
Corey Johnson
64bd26a392 Add Keymap.bindingsForElement method 2012-05-29 14:15:54 -07:00
Nathan Sobo
f2f44b9ab6 Can match key patterns with the '-' character
Add a parser to parse keystroke patterns instead of splitting on '-' with a regex
2012-05-09 10:56:31 -06:00
Nathan Sobo
846846abe8 Keymap normalizes key patterns so modifier keys can be listed in a random order. 2012-04-03 15:51:53 -06:00
Corey Johnson
1efb712fd3 Rename App.coffee to Atom.coffee. This also required moving src/atom,spec/atom to src/app,spec/app 2012-04-03 10:33:24 -07:00