From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "huxiaopengstat@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: How to simulate keyboard input in self-defined function? Date: Sat, 23 Aug 2008 07:34:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1219502442 2942 80.91.229.12 (23 Aug 2008 14:40:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Aug 2008 14:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 23 16:41:36 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KWuJ4-0004lc-Un for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Aug 2008 16:41:35 +0200 Original-Received: from localhost ([127.0.0.1]:60418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWuI6-0007C8-S9 for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Aug 2008 10:40:34 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q5g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: 60.168.80.193 Original-X-Trace: posting.google.com 1219502096 18276 127.0.0.1 (23 Aug 2008 14:34:56 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 23 Aug 2008 14:34:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q5g2000prf.googlegroups.com; posting-host=60.168.80.193; posting-account=cJrRhgoAAACz5rJlwBmKxh25p4FBj6H5 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:161566 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56910 Archived-At: On 8=D4=C223=C8=D5, =C9=CF=CE=E712=CA=B155=B7=D6, Rupert Swarbrick wrote: > > I want to simulate keyboard input in a function. > > > How to do it? > > > How to find build-in functions about "simulate keyboard input"? > > Well, unless you want to work out how to do whatever you want to do all > by yourself, I recommend giving a little more information about what you > want. > > Keyboard macros? > > Rupert > > application_pgp-signature_part > < 1KViewDownload I use gmail to use this forum. Below is my reply to above letter. Thanks for your warm heart! I want to simulate keystrike "t" + (not simultaneously). If what I get is not "t ", I know my input method is not english. Then I will simulate "Ctrl" once to toggle input method between english and chinese. Why I do this is that I want to define a function, which automatically switch my input method to english when I in math mode such as $...$, \[ ...\] (in latex file), switch to chinese when I out of math mode. In my computer , I do use another efficient input method ,whic use only "Ctrol" to switch between chinese and english. Input method builded in emacs is poor. I just don't know how to implement the function, using defined function or hook? I want emacs more intelligent in latex file. Every strike input real charater. Don't space many keystrike to toggle input method Thanks