 		if template.open.curValue isnt true
 			return
 
-		if event.which is 38
-			template.up()
-		else if event.which is 40
-			template.down()
-		else
+		if event.which not in [keys.ARROW_UP, keys.ARROW_DOWN]
 			Meteor.defer =>
 				template.verifySelection()
 

getCursorPosition = (input) ->
	if not input? then return
	if input.selectionStart?

		if template.open.curValue isnt true or template.hasData.curValue isnt true
			return

		if event.which in [keys.ARROW_UP, keys.ARROW_DOWN]
			event.preventDefault()
			event.stopPropagation()

		if event.which in [keys.ENTER, keys.TAB]
			template.open.set false

			template.enterValue()

			event.preventDefault()
			event.stopPropagation()

		if event.which is keys.ARROW_UP
			template.up()
		else if event.which is keys.ARROW_DOWN
			template.down()

	template.setTextFilter = _.debounce (value) ->
		template.textFilter.set(value)
	, template.textFilterDelay

	template.onInputKeyup = (event) =>
		if template.open.curValue is true and event.which is keys.ESC
			template.open.set false
			event.preventDefault()
			event.stopPropagation()
