Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Add Core#key_rate= to simplify dynamic key rate changes
Browse files Browse the repository at this point in the history
If, for instance, you need to make typing very slow for a
particular test, you can change the key rate before and
restore the original value later.
  • Loading branch information
ferrous26 committed May 17, 2012
1 parent a2bfc89 commit 64dd67c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/accessibility/core.rb
Expand Up @@ -429,7 +429,7 @@ def post events
end

##
# The delay between key presses. The default value is `0.01`, which
# The delay between key events. The default value is `0.01`, which
# should be about 50 characters per second (down and up are separate
# events).
#
Expand All @@ -448,6 +448,15 @@ def key_rate
else ENV['KEY_RATE'].to_f
end

##
# Set the delay between key events. This value is used by {#post}
# to slow down the typing speed so apps do not get overloaded.
#
# @param [Number]
def key_rate= value
@@key_rate = value
end


# @!group Element Hierarchy Entry Points

Expand Down

0 comments on commit 64dd67c

Please sign in to comment.