Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set input usb tablet? #1148

Open
fyoory opened this issue Feb 8, 2025 · 2 comments
Open

How to set input usb tablet? #1148

fyoory opened this issue Feb 8, 2025 · 2 comments

Comments

@fyoory
Copy link

fyoory commented Feb 8, 2025

By default this provider creates a mouse device with input set to ps2. Tho I am trying to get basically a way to set it to qemuargs = "-usbdevice tablet".

Sorry I am not familiar with xslt, so maybe it is in that. Does anyone have a working format to do a stop gap fix until the provider exposes things like input or qemuargs?

@fyoory
Copy link
Author

fyoory commented Feb 8, 2025

Perhaps I should say i want to have a device added like such:

<input type="tablet" bus="usb">
  <alias name="input0"/>
  <address type="usb" bus="0" port="1"/>
</input>

@solemnwarning
Copy link

It would be nice for this to be a first-class feature in the provider, but for the time being this XSLT stylesheet seems to work:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>

  <xsl:template match="node()|@*">
     <xsl:copy>
       <xsl:apply-templates select="node()|@*"/>
     </xsl:copy>
  </xsl:template>

  <xsl:template match="/domain/devices">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:copy-of select="node()"/>

      <input type="tablet" bus="usb">
        <address type="usb" bus="0" port="1"/>
      </input>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants