Bug 231370

Summary: [PATCH] devel/sdl12: improve joystick support
Product: Ports & Packages Reporter: rozhuk.im
Component: Individual Port(s)Assignee: Eugene Grosbein <eugen>
Status: Closed FIXED    
Severity: Affects Many People CC: amdmi3, eugen, rozhuk.im
Priority: --- Flags: eugen: maintainer-feedback-
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description rozhuk.im 2018-09-15 02:47:09 UTC
Created attachment 197098 [details]
patch

1. Update BSD driver:
 - do not use uhid devices like keyboard as joystick
 - add env SDL_JOYSTICK_DEVICE variable handle
 - some small improvements: set verbose names, code formatting

2. Add option to able to compile with linux driver.


Without this patch dgen report that my keyboard is joystick with "0 axes, 0 button(s), 0 hat(s)" and do not see mine gamepad.
Now via BSD driver dgen see both mine gamepads.
With linux I test only with one gamepad.
All works OK.
Comment 1 rozhuk.im 2018-09-15 17:00:12 UTC
Linux joystick driver need because then webcamd attach to gamepad/joyctisk then uhid disappear and native BSD driver in SDL 1.2 cant attach to it.
Comment 2 commit-hook freebsd_committer 2018-11-06 17:28:18 UTC
A commit references this bug:

Author: eugen
Date: Tue Nov  6 17:28:02 UTC 2018
New revision: 484313
URL: https://svnweb.freebsd.org/changeset/ports/484313

Log:
  devel/sdl12: improve joystick support

  1. Update BSD driver:
  - do not use uhid devices like keyboard as joystick
  - add env SDL_JOYSTICK_DEVICE variable handle
  - some small improvements: set verbose names, code formatting

  2. Add option to compile with linux driver.

  PR:		231370
  Submitted by:	Ivan Rozhuk <rozhuk.im@gmail.com>
  Approved by:	amdmi3 (maintainer timeout, 3 weeks)

Changes:
  head/devel/sdl12/Makefile
  head/devel/sdl12/files/input-event-codes.h
  head/devel/sdl12/files/input.h
  head/devel/sdl12/files/joystick.h
  head/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c
  head/devel/sdl12/files/types.h
  head/devel/sdl12/pkg-message.linjoy
Comment 3 Eugene Grosbein freebsd_committer 2018-11-06 17:29:48 UTC
Committed, thanks!