<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>217675</bug_id>
          
          <creation_ts>2020-10-13 15:12:22 -0700</creation_ts>
          <short_desc>Allow gamepad button press to count as a user gesture</short_desc>
          <delta_ts>2024-05-13 16:51:05 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=235052</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Justin Uberti">juberti</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1697435</commentid>
    <comment_count>0</comment_count>
    <who name="Justin Uberti">juberti</who>
    <bug_when>2020-10-13 15:12:22 -0700</bug_when>
    <thetext>Many of Safari&apos;s APIs require a user gesture, e.g.:
- fullscreen
- autoplay
- clipboard

However it is not possible to trigger a user gesture from an attached USB or Bluetooth gamepad, which makes it hard for apps to entirely drive their UI from a gamepad.

Chrome adopted an approach where a getGamepads() call with at least one button pushed more than 50% triggers a user gesture callback (https://bugs.chromium.org/p/chromium/issues/detail?id=381596#c13). This seems like it would be easy to adopt in Safari as well, assuming this approach gets a thumbs-up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1697977</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-10-14 17:44:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/70315471&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1698237</commentid>
    <comment_count>2</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2020-10-15 13:02:21 -0700</bug_when>
    <thetext>This seems like a reasonable thing to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1698279</commentid>
    <comment_count>3</comment_count>
    <who name="Justin Uberti">juberti</who>
    <bug_when>2020-10-15 14:17:47 -0700</bug_when>
    <thetext>OK, great. I&apos;ll look at grabbing a UserGestureToken somewhere like https://github.com/WebKit/webkit/blob/89c28d471fae35f1788a0f857067896a10af8974/Source/WebCore/platform/gamepad/GamepadProvider.cpp#L53 and see if that direction will work.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>