<commit_before>for key in ["Enter", "Escape", "Space", "Left", "Up", "Right", "Down"]
  do (key) ->
    angular.module("Mac").directive "macKeydown#{key}", ["$parse", "keys", ($parse, keys) ->
      restrict: "A"
      link: (scope, element, attributes) ->
        expression = $parse attributes["macKeydown#{key}"]
        element.on "keydown", (event) ->
          if event.which is keys["#{key.toUpperCase()}"]
            event.preventDefault()
            scope.$apply -> expression scope, $event: event
    ]<commit_msg>Updated keydown docs.<commit_after>###
@chalk overview
@name Keydown events

@description
A directive for handling certain keys on keydown event
Currently MacGyver supports enter, escape, space, left, up, right and down

@param {Expression} mac-keydown-enter  Expression to evaulate on hitting enter
@param {Expression} mac-keydown-escape Expression to evaulate on hitting escape
@param {Expression} mac-keydown-space  Expression to evaulate on hitting space
@param {Expression} mac-keydown-left   Expression to evaulate on hitting left
@param {Expression} mac-keydown-up     Expression to evaulate on hitting up
@param {Expression} mac-keydown-right  Expression to evaulate on hitting right
@param {Expression} mac-keydown-down   Expression to evaulate on hitting down
###

for key in ["Enter", "Escape", "Space", "Left", "Up", "Right", "Down"]
  do (key) ->
    angular.module("Mac").directive "macKeydown#{key}", ["$parse", "keys", ($parse, keys) ->
      restrict: "A"
      link: (scope, element, attributes) ->
        expression = $parse attributes["macKeydown#{key}"]
        element.on "keydown", ($event) ->
          if event.which is keys["#{key.toUpperCase()}"]
            event.preventDefault()
            scope.$apply -> expression scope, {$event}
    ]
{'fraction_non_alphanumeric': 0.1447661469933185, 'fraction_numerical': 0.0, 'mean_word_length': 3.7041884816753927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2348175', 'n_tokens_mistral': 516, 'n_tokens_neox': 522, 'n_words': 171}