nodes: 0, module; 1, function_definition; 2, function_name:func_on_enter; 3, parameters; 4, block; 5, identifier:func; 6, expression_statement; 7, function_definition; 8, return_statement; 9, comment:"""
      Register the `func` as a callback reacting only to ENTER.
  
      Note:
          This function doesn't bind the key to the element, just creates sort of
          filter, which ignores all other events.
      """; 10, function_name:function_after_enter_pressed; 11, parameters; 12, block; 13, identifier:function_after_enter_pressed; 14, identifier:ev; 15, expression_statement; 16, comment:# if the key was `enter` ..; 17, if_statement; 18, call; 19, comparison_operator:ev.keyCode == 13; 20, block; 21, attribute; 22, argument_list; 23, attribute; 24, integer:13; 25, expression_statement; 26, identifier:ev; 27, identifier:stopPropagation; 28, identifier:ev; 29, identifier:keyCode; 30, call; 31, identifier:func; 32, argument_list; 33, identifier:ev
code: def func_on_enter(func):
      """
      Register the `func` as a callback reacting only to ENTER.
  
      Note:
          This function doesn't bind the key to the element, just creates sort of
          filter, which ignores all other events.
      """
      def function_after_enter_pressed(ev):
          ev.stopPropagation()
  
          # if the key was `enter` ..
          if ev.keyCode == 13:
              func(ev)
  
      return function_after_enter_pressed