def key_press(*args)
      options = Hash === args.last ? args.pop : {}
      keys = args
      raise ArgumentError, 'Must have at least one key argument' if keys.empty?
      begin
        key_down keys.first
        if keys.length == 1
          yield if block_given?
        else
          key_press(*(keys[1..-1] + [options]))
        end
      ensure
        key_up keys.first
      end
    end
def key_press(*args)
      options = Hash === args.last ? args.pop : {}
      keys = args
      raise ArgumentError, 'Must have at least one key argument' if keys.empty?
      begin
        key_down keys.first
        if keys.length == 1
          yield if block_given?
        else
          key_press(*(keys[1..-1] + [options]))
        end
      ensure
        key_up keys.first
      end
    end
this takes an array of keys, and successively holds each down then lifts them up in
 reverse order.
 FIXME: should wait. can't recurse in that case.