Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:35:39+00:00 2026-06-11T12:35:39+00:00

As title, what I want to realize with Processing: There are classical circles running

  • 0

As title, what I want to realize with Processing:

There are classical circles running across on the screen, then:

The first time you click the mouse all the circles freeze(stop moving);

The second time you click the mouse you draw a new circle with your mouse position.

The problem is: How to tell the computer to act differently? After all, they are all clicks, seem the same to the computer.

I am thinking about to detect if something already happened in Processing(like the first click). if it cannot be done, can I use javascript to do so? I want to put it on the browser anyway.

Does anybody know? Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:35:40+00:00Added an answer on June 11, 2026 at 12:35 pm

    I presume it’s mostly up to how you envision the interaction. It can be as simple or as complex as you see fit.

    If it helps, here are couple of ideas:

    1.Use different actions for different mouse buttons (e.g. regular/left click spawns a new circle, right click moves existing circles to a desired location):

    void draw(){
      color bg = color(0);
      if(mousePressed){
        if(mouseButton == LEFT )  bg = color(192,0,0);
        if(mouseButton == CENTER) bg = color(0,192,0);
        if(mouseButton == RIGHT)  bg = color(0,0,192);
      }
      background(bg);  
    }
    

    2.Use button and key combinations. For example a SHIFT+CLICK does a separate action rather than the default:

    void draw(){
      color bg = color(0);//default
      if(mousePressed && keyPressed && keyCode == SHIFT) bg = color(255,192,0);//shift+click
      background(bg);  
    }
    

    3.Keep track of clicks and use the click number a cue to different states:

    int numClicks = 0;
    
    void draw(){
      background(numClicks*25);  
    }
    void mousePressed(){
      numClicks++;
      if(numClicks > 10) numClicks = 0;//reset after 10 'states'/different clicks
    }
    

    This, as an interaction is probably less intuitive though. In my opinion, the simpler things are (especially for the user), the better.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As title suggests I want to know the difference between the change and click
I want to give my graph a title in big 18pt font, then a
I want a program that does what I said in the title. I realize
I want to retrieve website title from webview cookies of my application. I am
I want to fetch the title from book table and the subject name from
I want to fetch the title of a webpage which I open using urllib2.
I want to convert the title of a page to a friendly URL and
I want to put a title field in a bibtex citation that includes angle
I want to change the title of the search bar cancel button to Offers
I want to have my title tag look like this: My Website - Name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.