From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 4B849284B6 for ; Sat, 19 Oct 2024 14:46:01 +0200 (CEST) Received: from cc-smtpout2.netcologne.de ([89.1.8.212]) by 9front; Sat Oct 19 08:44:56 -0400 2024 Received: from cc-app1.netcologne.de (cc-app1.netcologne.de [89.1.9.190]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id DE64512794 for <9front@9front.org>; Sat, 19 Oct 2024 14:44:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1729341892; bh=3hNrH5V956OTOwSRJSX9rVSTwFouwJ6003+pzFLCvjU=; h=Date:From:To:Message-ID:Subject:From; b=NE3UDus+k6ChAiVhFx/A0YESBguv587QHXgH+bBU1QagygpfUC7MPQqdaJjy+ETXj vYCJ0qDccFUj6JBNi1fSypPNzVLNjWpYofUypXRy5iGgTqJSvsY9gJhmQ2uFEvGQme GZCU/3L+OZzHJFDvrUfCKmGQynzrv46w62YoCNmkrvgM/DY0rLbHOXpPlRGlVA1iwT 62R46N4ctDn7Z6SfbkNjEakHTdvqr2+a/+hRChKDOj4QN1dozrm4EaBTiKmtnARRja MoLFbPC44gkF+k8jRNOg0IWVnGHb4/Nkwn8vVoc4rHL9maFsiD5tS3TaVEPlseALOu Gpwj4CEOG6duQ== Received: from cc-app1.netcologne.de (localhost [127.0.0.1]) by cc-app1.netcologne.de (Postfix) with ESMTPA id AF8E311D80 for <9front@9front.org>; Sat, 19 Oct 2024 14:44:52 +0200 (CEST) Date: Sat, 19 Oct 2024 14:44:52 +0200 (CEST) From: Arne Meyer To: "9front@9front.org" <9front@9front.org> Message-ID: <1471971331.1907621.1729341892650@comcenter.netcologne.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1907620_1649995391.1729341892650" X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev59 X-Originating-IP: 2a0a:a540:75e8:0:3403:c08:a171:32b0 X-Originating-Client: open-xchange-appsuite X-NetCologne-Spam: L X-Rspamd-Queue-Id: AF8E311D80 X-Spamd-Bar: - X-Rspamd-Action: no action List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: advanced SQL database software STM frontend Subject: [9front] [patch] nusb/ joy: xbox360 controller support and improved hid parsing Reply-To: 9front@9front.org Precedence: bulk ------=_Part_1907620_1649995391.1729341892650 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hello, this patch adds some improvements to nusb/joy. Support for xbox360 controllers. Up to six axes are now supported for analog input. The DPad gets mapped to buttons 16-19. Added a simple deadband filter for analog axes. Thanks qwx for feedback and help with the man page changes! Greetings, Arne ------=_Part_1907620_1649995391.1729341892650 Content-Type: application/octet-stream; name=nusbjoy.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=nusbjoy.patch X-Part-Id: c318e35ebbef49bbab3679bcae2c298e ZGlmZiAwYzRlNGNiOWU5MmUzNzJkYzBjYjNkZjE4Mjc5MGRjMGIxYzc1N2FkIHVuY29tbWl0dGVk Ci0tLSBhL3N5cy9tYW4vNC9udXNiCisrKyBiL3N5cy9tYW4vNC9udXNiCkBAIC00NCw2ICs0NCw5 IEBACiAuQiBudXNiL2pveQogWwogLkIgLWQKK10gWworLkIgLWIKKy5JIGRlYWRiYW5kCiBdCiAu SSBkZXZpZAogLlBQCkBAIC0xOTAsNyArMTkzLDcgQEAKIGFueSBjaGFuZ2VzIGluIHRoZSBkZXZp Y2UncyBheGVzIG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ZWFyCT0gMDw8NCwJRm5vbmxpbgk9IDE8PDQsCiAJRnByZWYJ PSAwPDw1LAlGbm9wcmVmCT0gMTw8NSwKIAlGbm9udWxsCT0gMDw8NiwJRm51bGxzdAk9IDE8PDYs Cit9OworCit1Y2hhciB4Ym94MzYwZGVzY1tdID0geworICAgIDB4MDUsIDB4MDEsCisgICAgMHgw OSwgMHgwNSwKKyAgICAweGExLCAweDAxLAorICAgIDB4NzUsIDB4MDgsCQorICAgIDB4OTUsIDB4 MDEsCQorICAgIDB4ODEsIDB4MDEsCisgICAgMHg3NSwgMHgwOCwKKyAgICAweDk1LCAweDAxLAor ICAgIDB4MDUsIDB4MDEsCisgICAgMHgwOSwgMHgzYiwKKyAgICAweDgxLCAweDAxLAorICAgIDB4 MDUsIDB4MDEsCQorICAgIDB4MDksIDB4MDEsCisgICAgMHhhMSwgMHgwMCwKKyAgICAweDc1LCAw eDAxLAorICAgIDB4MTUsIDB4MDAsCisgICAgMHgyNSwgMHgwMSwKKyAgICAweDM1LCAweDAwLAkK KyAgICAweDQ1LCAweDAxLAkKKyAgICAweDk1LCAweDA0LAorICAgIDB4MDUsIDB4MDEsCisgICAg MHgwOSwgMHg5MCwKKyAgICAweDA5LCAweDkxLAorICAgIDB4MDksIDB4OTMsCisgICAgMHgwOSwg MHg5MiwKKyAgICAweDgxLCAweDAyLAorICAgIDB4YzAsCisgICAgMHg3NSwgMHgwMSwKKyAgICAw eDE1LCAweDAwLAorICAgIDB4MjUsIDB4MDEsCisgICAgMHgzNSwgMHgwMCwKKyAgICAweDQ1LCAw eDAxLAorICAgIDB4OTUsIDB4MDcsCisgICAgMHgwNSwgMHgwOSwKKyAgICAweDA5LCAweDA4LAor ICAgIDB4MDksIDB4MDcsCisgICAgMHgwOSwgMHgwOSwKKyAgICAweDA5LCAweDBhLAorICAgIDB4 MDksIDB4MDUsCisgICAgMHgwOSwgMHgwNiwKKyAgICAweDA5LCAweDBiLAorICAgIDB4ODEsIDB4 MDIsCisgICAgMHg3NSwgMHgwMSwKKyAgICAweDk1LCAweDAxLAorICAgIDB4ODEsIDB4MDEsCisg ICAgMHg3NSwgMHgwMSwKKyAgICAweDE1LCAweDAwLAorICAgIDB4MjUsIDB4MDEsCisgICAgMHgz NSwgMHgwMCwKKyAgICAweDQ1LCAweDAxLAorICAgIDB4OTUsIDB4MDQsCisgICAgMHgwNSwgMHgw OSwKKyAgICAweDE5LCAweDAxLAorICAgIDB4MjksIDB4MDQsCisgICAgMHg4MSwgMHgwMiwJCisg ICAgMHg3NSwgMHgwOCwKKyAgICAweDE1LCAweDAwLAorICAgIDB4MjYsIDB4ZmYsIDB4MDAsCisg ICAgMHgzNSwgMHgwMCwKKyAgICAweDQ2LCAweGZmLCAweDAwLAorICAgIDB4OTUsIDB4MDIsCisg ICAgMHgwNSwgMHgwMSwKKyAgICAweDA5LCAweDMyLAorICAgIDB4MDksIDB4MzUsCisgICAgMHg4 MSwgMHgwMiwKKyAgICAweDc1LCAweDEwLAorICAgIDB4MTYsIDB4MDAsIDB4ODAsCisgICAgMHgy NiwgMHhmZiwgMHg3ZiwKKyAgICAweDM2LCAweDAwLCAweDgwLAorICAgIDB4NDYsIDB4ZmYsIDB4 N2YsCisgICAgMHg5NSwgMHgwNCwKKyAgICAweDA1LCAweDAxLAorICAgIDB4MDksIDB4MzAsCisg ICAgMHgwOSwgMHgzMSwKKyAgICAweDA5LCAweDMzLAorICAgIDB4MDksIDB4MzQsCisgICAgMHg4 MSwgMHgwMiwKKyAgICAweDc1LCAweDMwLAorICAgIDB4OTUsIDB4MDEsCisgICAgMHg4MSwgMHgw MSwKKyAgICAweGMwLAogfTsKLS0tIGEvc3lzL3NyYy9jbWQvbnVzYi9qb3kvam95LmMKKysrIGIv c3lzL3NyYy9jbWQvbnVzYi9qb3kvam95LmMKQEAgLTQ3LDYgKzQ3LDcgQEAKIH0KIAogc3RhdGlj IGludCBkZWJ1Zywga2JkOworc3RhdGljIGRvdWJsZSBkZWFkYmFuZDsKIAogc3RhdG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