Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'dynamically': 0.07; 'parameter': 0.07; 'purpose.': 0.07; 'behavior,': 0.09; 'modifier': 0.09; 'typed': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; ':-)': 0.13; 'do,': 0.15; '-tkc': 0.16; 'chunk)': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'keys.': 0.16; 'message-id:@tim.thechases.com': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'simulate': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'undo': 0.16; 'undone': 0.16; 'wrote:': 0.17; 'specifies': 0.17; 'tim': 0.18; 'keys': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; '(which': 0.26; 'subject:please': 0.27; "doesn't": 0.28; 'chase': 0.29; "d'aprano": 0.29; 'steven': 0.29; 'case,': 0.29; 'class': 0.29; 'function': 0.30; 'affects': 0.33; 'languages': 0.33; 'feed': 0.35; 'nov': 0.35; 'similar': 0.35; 'something': 0.35; 'add': 0.36; 'should': 0.36; 'signature': 0.37; 'does': 0.37; 'uses': 0.37; 'passed': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'called': 0.39; 'where': 0.40; 'more': 0.63; 'distinguish': 0.84; 'keystrokes': 0.84; 'received:50.22': 0.84; 'sees,': 0.84 Date: Tue, 20 Nov 2012 19:30:37 -0600 From: Tim Chase User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: Steven D'Aprano Subject: Re: 10 sec poll - please reply! References: <3d71f175-164e-494c-a521-2eaa5679b524@googlegroups.com> <50ac2ba6$0$29987$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <50ac2ba6$0$29987$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353461394 news.xs4all.nl 6932 [2001:888:2000:d::a6]:37349 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33691 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