lib/vedeu/dsl/keymap.rb in vedeu-0.4.40 vs lib/vedeu/dsl/keymap.rb in vedeu-0.4.41

- old
+ new

@@ -19,29 +19,37 @@ # this can be discerned from the interface itself, e.g: # # Vedeu.interface 'my_interface' do # keymap do # # ... + # end + # end # # @param name [String] The name of the interface which this keymap relates # to. # @param block [Proc] # # @example # Vedeu.keymap 'my_interface' do # # ... + # end # # Vedeu.keys 'my_interface' do # # ... + # end # # Vedeu.interface 'my_interface' do # keymap do # # ... + # end + # end # # Vedeu.interface 'my_interface' do # keys do # # ... + # end + # end # # @raise [InvalidSyntax] The required block was not given. # @return [Keymap] # @todo Try to remember why we need to pre-create the keymap in the # repository. @@ -74,13 +82,14 @@ # Vedeu.keymap do # key('s') { Vedeu.trigger(:save) } # key('h', :left) { Vedeu.trigger(:left) } # key('j', :down) { Vedeu.trigger(:down) } # key('p') do - # ... + # # ... # end - # ... + # # ... + # end # # @raise [InvalidSyntax] When the required block is not given, the # value_or_values parameter is undefined, or when processing the # collection, a member is undefined. # @return [Array] A collection containing the keypress(es). @@ -106,13 +115,9 @@ # same name as the interface. # # When the name '_global_' is used, all keys in the keymap block will be # available to all interfaces. Once a key has been defined in the # '_global_' keymap, it cannot be used for a specific interface. - # - # @note Using the name of a keymap that already exists will overwrite that - # keymap. Do not use the name '_system_' as unexpected behaviour may - # occur. # # @param value [String] # @return [String] def name(value) model.name = value