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 1QymZn-0000dv-DN for garchives@archives.gentoo.org; Wed, 31 Aug 2011 15:19:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 46BFD21C32D; Wed, 31 Aug 2011 15:19:30 +0000 (UTC) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 96B8F21C306 for ; Wed, 31 Aug 2011 15:18:31 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so1183879bkb.40 for ; Wed, 31 Aug 2011 08:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=1miFb2WzFb/5XdJEzR4TIbg2pFjVpGVwcDDHeGy/u3o=; b=v7lKYhhZMZGCGlgj55smVp8BUJZfCL8hLCiLkvOOY+KntEg5xzT8Uk0QhMxo2UywLm dMxYsk49YV5exkF+gdqOYbKcPP+dPzTiXAjFvT0kj0rOI426bayHv0vffDD8PVcBCBYB k8WiStiVu9/4vZABY7fGLlqCc8dL40P44dT2E= Received: by 10.204.157.19 with SMTP id z19mr339342bkw.266.1314803910648; Wed, 31 Aug 2011 08:18:30 -0700 (PDT) Received: from brutal.emea.cpqcorp.net (business-80-99-239-77.business.broadband.hu [80.99.239.77]) by mx.google.com with ESMTPS id z6sm416701bks.24.2011.08.31.08.18.27 (version=SSLv3 cipher=OTHER); Wed, 31 Aug 2011 08:18:27 -0700 (PDT) Message-ID: <4E5E50C2.30900@gmail.com> Date: Wed, 31 Aug 2011 17:18:26 +0200 From: Space Cake User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20110824 Thunderbird/6.0 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 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Typewriter sound References: <20100817172005.GA5110@solfire> <1282067763.451766.3.camel@paska> <4C6AD12F.4020007@gmail.com> <20100817184309.GA9068@solfire> <1282073645.451766.13.camel@paska> In-Reply-To: <1282073645.451766.13.camel@paska> X-Enigmail-Version: 1.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: e84fd9120eb83351c31d42f2b4cba1ef -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 2010-08-17 21:34 keltez=C3=A9ssel, Albert Hopkins =C3=ADrta: > 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.=20 >>>>> There was an interesting detail: While there were spoken=20 >>>>> 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,=20 >>>>> 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 then 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 >>=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 >>=20 >=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=20 > 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:=20 > subprocess.Popen(['aplay', soundfile], stderr=3Dopen('/dev/null',=20 > 'w')) >=20 >=20 > if __name__ =3D=3D '__main__': main() >=20 >=20 >=20 Guys, this is awesome :) Let's make an ebuild and put in portage :) L: -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOXlDCAAoJECu/a/sBwapoXS0IAMKolA55zV/mAQqlwe/qvk1w HyVpirrOYYYQOsdJChnvYfpgWBUT0F8uwEaO1pLGdlACrN0VHYJMk45nC8PBtKkL gkrnR0Q0Ew6bZ1DeXjd2x+jZEN5Am6vQCHxLd85OJfTvIM7Ahc+FdJWtfhcaO8IF hXppxITOQ9hCH+iEhel6TTq4wAQjX/i0C6RsF9RTGbocAzCdpZSs/RPffQiHuScv IBrKOxLCQ2TACmdYmbK47vCKH6rgsNDENWD19g9zVouHHtXLeBnavG42wV46qCUW OmNoKFA00ZXmuVUhpyUhhLSv6D4n5w7TFKdNXFof6Whf6/9X82oVe4yQCgbC+E8=3D =3DR2iT -----END PGP SIGNATURE-----