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

double click on GUI w. touchscreen #11

Closed
ryancoe opened this issue Jul 6, 2020 · 5 comments
Closed

double click on GUI w. touchscreen #11

ryancoe opened this issue Jul 6, 2020 · 5 comments
Assignees
Labels
GUI Graphical user interface

Comments

@ryancoe
Copy link
Member

ryancoe commented Jul 6, 2020

currently, you need to click twice to make anything happen with the touch screen GUI

@ryancoe ryancoe added the GUI Graphical user interface label Aug 10, 2020
@ryancoe
Copy link
Member Author

ryancoe commented Aug 10, 2020

@delaneyheileman - Sounds like you may have already seen this, but there's another library (alternative to controlP5) called 4GP that sounds like it handles touch screens better: https://forum.processing.org/two/discussion/4346/processing-application-on-a-touch-screen-tablet.

Looks like this is an unresolved issue for controlP5 (unless I'm missing something): sojamo/controlp5#159; sojamo/controlp5#92

@delaneyheileman
Copy link
Collaborator

Still working on this - recompiling .java file this week and trying that fix

@delaneyheileman
Copy link
Collaborator

Its finally working!! Changes pushed to touchscreen branch - we can talk about merging to master soon. The touchscreen functionality is working now but the colors of the buttons are not changing as they should (they look like they are selected when they are not). I will make that a new issue.

@delaneyheileman
Copy link
Collaborator

Adding some documentation for how this bug was fixed/ how to generally compile a java library properly.

Touch screen fix/ updating a processing library:

Some background information:
The src folder, which contains the code that defines the library, is no used by Processing. Instead, Processing uses the associated .jar file.

So what is a .jar file?

It's the java equivalent of a ZIP file. When a library src folder is compiled it makes a .jar file, aggregating all of the information from the various files into the source folder into one .jar file that Processing uses.

Why is this important?

Well, let's say you want to make a change to a specific library. You modify a file in the src folder. You think you are done but when you run the code again, nothing changes. This is because you just changed one file, you didn’t recompile the .jar, so processing is still using a .jar file that doesn’t have your new changes taken into account. What is convenient about this is that you can share .jar files with people, so once you make your library fix you can pass on your properly compiled .jar file to those on your team. Easy peasy.

Okay so I need to recompile my .jar file once I make a change?

Yes!

And I do that. . . how?

So glad you asked. This is where things get a bit tricky because you will need to make changes based on your environment.

1. Make any changes you wish to your respective library.

2. Find the core.jar file the comes with Processing and make a note of its path/copy the path into a note for later use. Bellow are the steps I followed on a Mac computer.

  • On Mac I did this by going to applications in finder, right clicking the processing application and selecting “show contents”

image

  • From there I navigated through the files. Contents/Java/core/library/core.jar
  • this path is likely to be different depending on you machine. Many people online report the path to be something like: contents/resources/library/. . . so just look around
  • Make sure you have this available, I would copy it into a note for later use.

3. Now open a terminal and navigate to the src folder of the library you are changing.

  • THIS IS DIFFERENT THAN THE PATH DESCRIBED IN SET 3.
  • It will be something like: siweed/Processing/libraries/controlP5/src/controlP5

*4. Run javac -cp CORE_DOT_JAR_PATH/core.jar -d . --target 8 --source 8 .java

  • The CORE_DOT_JAR_PATH is the path you found in step 3
    5. Now run: Run jar -cf PROCESSING_FOLDER_PATH/libraries/controlP5/library/controlP5.jar controlP5

Touch screen only: set isTouch to true

@delaneyheileman
Copy link
Collaborator

@SeanPluemer see above documentation, this might help you with compiling the library you changed.

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

No branches or pull requests

2 participants