<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with setmouseover() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=setmouseover%28%29</link>
      <pubDate>Sun, 08 Aug 2021 17:56:59 +0000</pubDate>
         <description>Tagged with setmouseover() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedsetmouseover%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Removing mouseover state in controlP5</title>
      <link>https://forum.processing.org/two/discussion/27703/removing-mouseover-state-in-controlp5</link>
      <pubDate>Fri, 06 Apr 2018 13:16:27 +0000</pubDate>
      <dc:creator>steve_j</dc:creator>
      <guid isPermaLink="false">27703@/two/discussions</guid>
      <description><![CDATA[<p>Having a small problem with controlP5 in android. The first press of a button triggers the mouseoverstate and not a trigger of the button. Is there anyway to bypass this? I have tried to set the mouseOver to true but doesnt help.</p>

<p>The three image files are being used for debug. Really i only need two.</p>

<pre><code>PImage[] imgsMinus = {loadImage("Volume-2.png"), loadImage("Volume-1.png"), loadImage("Volume.png")};
PImage[] imgsPlus = {loadImage("Volume-2.png"), loadImage("Volume-1.png"), loadImage("Volume.png")};

cp5.addButton("down")
      .setValue(-1)
      .setMouseOver(true)
      .setImages(imgsMinus)
      .updateSize()
      .setPosition(100, 100)

cp5.addButton("UP")
      .setValue(1)
      .setMouseOver(true)
      .setImages(imgsPlus)
      .updateSize()
      .setPosition(100, 100)
</code></pre>
]]></description>
   </item>
   <item>
      <title>ControlP5 setLock(true) doesn't work when Button is under mouse</title>
      <link>https://forum.processing.org/two/discussion/21706/controlp5-setlock-true-doesn-t-work-when-button-is-under-mouse</link>
      <pubDate>Thu, 30 Mar 2017 15:35:47 +0000</pubDate>
      <dc:creator>stefandz</dc:creator>
      <guid isPermaLink="false">21706@/two/discussions</guid>
      <description><![CDATA[<p>Not sure if I am being completely daft here, but I am finding an issue where using setLock(true) to disable a ControlP5 button works only if the button you are modifying doesn't have the mouse over it when setLock(true) is called. Example code (originally by <a href="/two/profile/andreas">@andreas</a>.schlegel from his answer <a rel="nofollow" href="https://forum.processing.org/one/topic/controlp5-disable-gui-elements.html#25080000000975458">here</a>)</p>

<pre><code>import controlP5.*;

ControlP5 controlP5;
int col;

void setup() {
  size(640,480);
  smooth();
  frameRate(30);
  controlP5 = new ControlP5(this);
  controlP5.addButton("buttonA",0,100,100,80,19);
  controlP5.addButton("buttonB",255,100,120,80,19);
  controlP5.addButton("buttonC",128,100,140,80,19);

  // store the original background color, we gonna need it later
  col = controlP5.getController("buttonC").getColor().getBackground();
  // lock Controller 'buttonC'
  setLock(controlP5.getController("buttonC"),true);
}


void setLock(Controller theController, boolean theValue) {
  theController.setLock(theValue);
  if(theValue) {
    theController.setColorBackground(color(100,100));
  } else {
    theController.setColorBackground(color(col));
  }
}

void keyPressed() {
  // temporarily enable/disable Controller 'buttonC'
  if(key=='1') {
    setLock(controlP5.getController("buttonC"), false);
  } else if(key=='2') {
    setLock(controlP5.getController("buttonC"), true);
  }
}

void draw() {
  background(0);
}

public void controlEvent(ControlEvent theEvent) {
  println(theEvent.controller().getName());
}
</code></pre>

<p>Run this and use the 1 and 2 keys to unlock and lock buttonC. Works well, except if you leave your mouse hovering over the buttonC while pressing 1 and 2. Has anyone come across this before? Is there a workaround? I am happy to try and work out a fix if anyone has any idea roughly where within ControlP5 to go hunting for this!!</p>

<p>FWIW I am using Processing 3.2.3 and ControlP5 2.2.6</p>
]]></description>
   </item>
   </channel>
</rss>