From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Character repeation detection Date: Sun, 9 Mar 2014 23:29:22 +0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1394382570 14020 80.91.229.3 (9 Mar 2014 16:29:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2014 16:29:30 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Tom Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 09 17:29:39 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WMgbZ-0006ub-PP for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Mar 2014 17:29:37 +0100 Original-Received: from localhost ([::1]:44726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMgbZ-0002zU-C9 for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Mar 2014 12:29:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMgbO-0002zN-H8 for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 12:29:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMgbL-0001Dx-9o for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 12:29:26 -0400 Original-Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]:52019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMgbL-0001Dq-4y for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 12:29:23 -0400 Original-Received: by mail-qg0-f45.google.com with SMTP id j5so17751797qga.4 for ; Sun, 09 Mar 2014 09:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0Gk6PiCRppO8sFhcTRULFmI2RQiIUjxKVPosdIu4qk8=; b=hJRVocyUcTbLgr4Lns8F9uwWwzfWGpTalp1AuHVlyraOlAPcpg4fPUAHWhrG1wJggE f1N6qmzbtgjOytkbkxzyvRd2uQ7lfTodj4AxspCo5II+LR2AOnrjxsGXfC6b83z7hbu5 B6tpkjRSqovpr4SzeMPOtJeWu2f+mS1UcPPV5tQPqYo9kdZFHpZB1U6bxvuGKGcKXXBy Lb1uYITQmEQipcjauZxBO99gYiqZL5oR/MyOXIAA0wyCwx+E5XWFHJe66FbkYBXghBd2 G5cyuid7P+LeVYHRbkrd2/otJImhKx67T9g7p/cqq/5k/HYcZiHhqGHbF7/BQe2Xo3+R 3LhA== X-Received: by 10.224.60.193 with SMTP id q1mr35181381qah.67.1394382562541; Sun, 09 Mar 2014 09:29:22 -0700 (PDT) Original-Received: by 10.96.77.40 with HTTP; Sun, 9 Mar 2014 09:29:22 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: MOJwXDMeaJVPtzWNPZissKYW0Uk X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96339 Archived-At: On Sun, Mar 9, 2014 at 12:47 PM, Tom wrote: > Is there a function or package to detect if a character is typed > repeatedly? E.g. if a is typed 3 or more times in a row (aaa...) > then call a function. > > Is there an existing solution for this? > > It would even be better if it had repetition suppression, that is > if I leave my finger on a key so I type a string of a certain character > (aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) then after the first 3 repetition > the function is called and the rest of the repeated characters are > removed from the keyboard buffer. What kind of function do you have in mind to call in such cases? Is it about preventing key autorepeat? Then just disable autorepeat in your system, or set a very high autorepeat delay and/or low rate. What about repeated key presses and releases, do you want to suppress that too? You might want to enable a key filtering accessibility feature.