GithubHelp home page GithubHelp logo

Comments (4)

kurikaesu avatar kurikaesu commented on June 12, 2024

Thanks for reaching out. Do you see your device as selection choice when running the GUI? If so it probably means the config is being saved in a weird state or under the wrong ID.

The actual saving of the configuration is handled by both this GUI and the daemon code.

Daemon Code:

For completeness sake, the daemon code that handles saving config changes is here: https://github.com/kurikaesu/userspace-tablet-driver-daemon/blob/main/src/event_handler.cpp#L135-L150

It obtains the configuration to save from the individual device handlers themselves. For the G640, it would be here: https://github.com/kurikaesu/userspace-tablet-driver-daemon/blob/main/src/star_g640.cpp#L39-L54

Specifically line 53 is what sets the configuration by calling this function: https://github.com/kurikaesu/userspace-tablet-driver-daemon/blob/main/src/transfer_handler.cpp#L420

Gui Code:

For the GUI side of things, it works by loading in the existing configuration and then overwriting a device's specific configuration then saving it. This can be seen here on the Artist 16 pro controller for example: https://github.com/kurikaesu/userspace-tablet-driver-gui/blob/main/src/main/kotlin/dev/villanueva/userland_utility/products/xppen/artist_pro_16/ArtistPro16Controller.kt#L26-L29

This is actually used here by the commitChanges code:

open fun commitChanges(deviceConfiguration: DeviceConfiguration?) {
println("Committing changes")
if (deviceConfiguration != null) {
deviceConfiguration.mapping.stylusButtons = this.stylusButtonMappings
deviceConfiguration.mapping.buttons = this.buttonBindings
deviceConfiguration.mapping.dials = this.dialBindings
deviceConfiguration.disabled.stylusButtons = this.stylusButtonDisabled
deviceConfiguration.disabled.buttons = this.buttonDisabled
deviceConfiguration.disabled.dials = this.dialDisabled
val existingConfig = updateExistingDeviceConfig(deviceConfiguration)
existingConfig.writeConfig()
if (DriverSocket.connected) {
DriverPackets.reloadConfiguration().writeToOutputStream(DriverSocket.getOutputStream()!!)
}
}
}

Line 114 will send a message packet to the driver daemon telling it to reload the configuration which is how the config is updated in semi-real-time.

from userspace-tablet-driver-gui.

kurikaesu avatar kurikaesu commented on June 12, 2024

Now that the details of the implementation are shown above, the next steps is to get you to provide a set of pull requests with the changes you have made. I'll be able to inspect what is going on in your code and hopefully either point out what needs to be updated to get it to work or we will find some weird bug/implementation difference that your specific tablet has that needs to be researched and then accounted for.

Reference your pull requests (for the daemon as well if you have code changes there) in this thread once you are done.

from userspace-tablet-driver-gui.

jonathannerat avatar jonathannerat commented on June 12, 2024

Okay, I got into the daemon to try and arrange a new driver for g640s, and got the buttons working (basically by copying from generic_xp_pen_device), but still can't get it to work.

Still, I think the problem is within the UI. I saved my changes in the daemon to another branch, switched to main, and with the my modified version of the gui I get this:

  • If I launch the gui, select the device, set ONLY stylus button 1 (for example, to right click), and save, the mapping works.
  • Same as above, but set ONLY stylus button 2 (for example, to middle click), and save, the mapping works.
  • Same, but if I try to do both at the same time, it doesn't work. It's like they cancel each other out.

I'll make a PR with the changes so you can try it, would love some input on this.

from userspace-tablet-driver-gui.

kurikaesu avatar kurikaesu commented on June 12, 2024

Thanks. I could be remembering incorrectly since it has been a while but the generic driver doesn't really have proper mappings at it doesn't properly save anything. Not sure if that is what you are trying to do here but if you are then the first step is to make sure to create a daemon implementation for your specific device first so that it has a proper device ID to map the configurations to.

Let's get the daemon changes done first so that we can make sure that all of the stylus buttons are actually assignable in the daemon itself. Once you have that PR ready please send it through and I'll have a look over it.

from userspace-tablet-driver-gui.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.