10 sec poll - please reply!

Tim Chase python.list at tim.thechases.com
Tue Nov 20 20:30:37 EST 2012


On 11/20/12 19:17, Steven D'Aprano wrote:
> On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote:
>> Just to add one more to the pot, Vim uses "feedkeys()" for a similar
>> purpose.
> 
> What does it feed to the keys?

In Vim's case, the signature would be something like

  def feedkeys(str, mode='m'):
    ...

where the 'mode' parameter specifies whether keystrokes should be
passed through the key-remapping functionality, and whether they
should be treated as typed or as a mapping-unit (which affects undo
behavior, whether each key is undoable, or if it's undone as a chunk)

Vim has the advantage that feedkeys() only has to deal with the keys
that Vim sees, which doesn't distinguish keydown/keyup events, or
the presses of modifier keys.

> Hypercard and other XTalk languages use "type" to simulate typing.

However, I suspect that they don't _also_ have a type() function to
dynamically determine the class of an object (or, if they do, it's
called something other than type() :-)

-tkc






More information about the Python-list mailing list