mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
18e614e88d
KeyEventHandler holds references to BindingSets. The name "binding set" is based on the concept of a CSS ruleset. The idea is to choose a key binding for an event based on what selectors (match / most closely contain) the event's target DOM node.
25 lines
618 B
CoffeeScript
25 lines
618 B
CoffeeScript
nakedLoad 'jasmine-jquery'
|
|
$ = require 'jquery'
|
|
_ = require 'underscore'
|
|
Native = require 'native'
|
|
|
|
afterEach ->
|
|
(new Native).resetMainMenu()
|
|
|
|
window.atom = new (require 'app')
|
|
|
|
window.keydown = (pattern) ->
|
|
console.log @createKeyEvent(pattern)
|
|
$(document).trigger @createKeyEvent(pattern)
|
|
|
|
window.createKeyEvent = (pattern) ->
|
|
$.Event "keydown", atom.keyBinder.parseKeyPattern(pattern)
|
|
|
|
window.keypressEvent = (pattern, properties={}) ->
|
|
$.Event "keypress", _.extend(atom.keyBinder.parseKeyPattern(pattern), properties)
|
|
|
|
window.waitsForPromise = (fn) ->
|
|
window.waitsFor (moveOn) ->
|
|
fn().done(moveOn)
|
|
|