From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OlTyM-0002D0-7k for garchives@archives.gentoo.org; Tue, 17 Aug 2010 21:45:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7B8C0E09E4; Tue, 17 Aug 2010 21:44:58 +0000 (UTC) Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com [74.125.82.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 4306FE09E4 for ; Tue, 17 Aug 2010 21:44:58 +0000 (UTC) Received: by wwd20 with SMTP id 20so3016288wwd.10 for ; Tue, 17 Aug 2010 14:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=ZbqSEYyfmLxKYvfRlXSUxJQxpRCf+B3Vmc5g0HHnIVw=; b=CptuRoPCv/PPbW06LteYZhQCiOlf1vzL9EZ7F7yfml2l0whPJgfWe4qVSGg6yrSiSC K8ZzGul+aRVgp0/+IyeDfJK8rafHvu1SALmCSdXrg4Z0WCj/r7HtkLVjZ8OgL6pYC2Po hYPq+YvYFyg7G1gTWM6jc4khlOpI+HHwXJP1Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=AKimfCRN6W4JQhQcd/r7TB8clKmrP57aiqAjLXmE2l+Fsy0mpr+Y2XlBOaM6s7hQ9V 60iGZp3Wu9JJNyqL5IZmYjXZHjxgkJgNKYGmkRKLKECB0Jdde2yqvm2SVtBuEE4rUAnC 1LA0buwA2ZP7DcmQaSeE+qhF/XrHAvBeD0XOA= Received: by 10.227.2.203 with SMTP id 11mr5935087wbk.207.1282081497194; Tue, 17 Aug 2010 14:44:57 -0700 (PDT) Received: from (230.3.169.217.in-addr.arpa [217.169.3.230]) by mx.google.com with ESMTPS id r10sm6918182wbe.18.2010.08.17.14.44.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 17 Aug 2010 14:44:55 -0700 (PDT) From: Mick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Typewriter sound Date: Tue, 17 Aug 2010 22:44:52 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.34-gentoo-r1; KDE/4.4.5; x86_64; ; ) References: <20100817172005.GA5110@solfire> <20100817184309.GA9068@solfire> <1282073645.451766.13.camel@paska> In-Reply-To: <1282073645.451766.13.camel@paska> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1470882.MAWAFbMi4c"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201008172244.55311.michaelkintzios@gmail.com> X-Archives-Salt: 27e6bccd-bee1-4a55-9bbb-34f93d771a35 X-Archives-Hash: e3c7a636cd9a5b17d13bc83d966d9d85 --nextPart1470882.MAWAFbMi4c Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tuesday 17 August 2010 20:34:05 Albert Hopkins wrote: > On Tue, 2010-08-17 at 20:43 +0200, meino.cramer@gmx.de wrote: > > Bill Longman [10-08-17 20:16]: > > > On 08/17/2010 10:56 AM, Albert Hopkins wrote: > > > > On Tue, 2010-08-17 at 19:20 +0200, meino.cramer@gmx.de wrote: > > > >> Hi, > > > >>=20 > > > >> on YouTube there was a Blender-2.5 tutorial with audio. > > > >> There was an interesting detail: While there were spoken > > > >> instructions one can hear one typing on its keyboard. > > > >> Each hit on one of the keys made the sound of an old > > > >> typewriter (no, it was not the sound of the legendary > > > >> "IBM Model M" keyboard ;) ). > > > >> =20 > > > >> How can I achieve this? > > > >> What software can I use to make this geeky feature to > > > >> come true. > > > >> Unfortunately I have no idea, how to name this kind > > > >> of what(?) ... > > > >> =20 > > > >> Thank you very much for any hint in advance! > > > >> Best regards, > > > >> mcc > > > >=20 > > > > There probably a number of ways to do this. > > > >=20 > > > > A cheap and easy way would be to use xev to monitor a window and th= en > > > > pipe the stderr to a a program that waits for a keypress event and > > > > then plays an apropriate. > > > >=20 > > > > A less cheap way would be to have our program do what xev does > > > > instead of using a pipe. > > >=20 > > > Or you could set your X keyclick using xset. > >=20 > > Hi, > >=20 > > thanks a lot for your replies! :) > > Is there any program already, which does this? > > A daemon or... > > =20 > > Best regards, > > mcc >=20 > Well I found out that when you pass window id to xev it does not trap > keyboard presses per-s=C3=A9. But there is another way... >=20 > Anway the following is a quick hack (in python). It pretty much works > except it also seems to trap mouse presses. I got the .wav file at > http://www.soundjay.com/typewriter-sounds.html >=20 > I tried using 'xset c' but it basically does nothing for me. My guess > is that it does work it basically sends the a BELL to the console. >=20 >=20 > --- 8< CUT HERE --------------------------------------------------- > import sys > import subprocess >=20 > soundfile =3D 'typewriter-key-1.wav' >=20 > def main(): > window_id =3D sys.argv[1] > cmd =3D ['xev', '-id', window_id] >=20 > p1 =3D subprocess.Popen(cmd, stdout=3Dsubprocess.PIPE) > while True: > line =3D p1.stdout.readline() > if line.find('atom 0x14d') > -1: > subprocess.Popen(['aplay', soundfile], > stderr=3Dopen('/dev/null', > 'w')) >=20 >=20 > if __name__ =3D=3D '__main__': > main() xset b on or xset c on do not work here either. =2D-=20 Regards, Mick --nextPart1470882.MAWAFbMi4c Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEABECAAYFAkxrAtcACgkQVTDTR3kpaLbJEACcDTSdT8eT2QW2FB4ruHQ2aRp6 GogAoJKEAvtsooQbi2Nfhw9y595gv/hv =ojnW -----END PGP SIGNATURE----- --nextPart1470882.MAWAFbMi4c--