From patchwork Thu Aug 11 05:07:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: walimis X-Patchwork-Id: 1055832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7B5OG0V003362 for ; Thu, 11 Aug 2011 05:24:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752200Ab1HKFYH (ORCPT ); Thu, 11 Aug 2011 01:24:07 -0400 Received: from mail.windriver.com ([147.11.1.11]:53904 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752179Ab1HKFYC (ORCPT ); Thu, 11 Aug 2011 01:24:02 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id p7B5Nu1m027527 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 10 Aug 2011 22:23:56 -0700 (PDT) Received: from localhost.localdomain (128.224.162.211) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.1.255.0; Wed, 10 Aug 2011 22:23:54 -0700 From: Liming Wang To: Pekka Enberg CC: Sasha Levin , Ingo Molnar , Asias He , Subject: [PATCH 3/3] kvm tools: enable keyboard press repeat for sdl Date: Thu, 11 Aug 2011 13:07:47 +0800 Message-ID: <1313039267-25951-3-git-send-email-walimisdev@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1313039267-25951-1-git-send-email-walimisdev@gmail.com> References: <1313039267-25951-1-git-send-email-walimisdev@gmail.com> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 11 Aug 2011 05:24:17 +0000 (UTC) Set keyboard repeat rate to enable keyboard press repeat. It means that don't repeat the key value every 50 milliseconds until 200 milliseconds later when the key is pressed. Signed-off-by: Liming Wang --- tools/kvm/ui/sdl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/kvm/ui/sdl.c b/tools/kvm/ui/sdl.c index 088cd29..6320ce7 100644 --- a/tools/kvm/ui/sdl.c +++ b/tools/kvm/ui/sdl.c @@ -99,6 +99,8 @@ static void *sdl__thread(void *p) if (!screen) die("Unable to set SDL video mode"); + SDL_EnableKeyRepeat(200, 50); + for (;;) { SDL_BlitSurface(guest_screen, NULL, screen, NULL); SDL_Flip(screen);