473,698 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a way to detect a held-down button while the mouse is moving?

Is there a way to detect a held-down button while
the mouse is moving?

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 3 '07 #1
6 3551
Eric Layman said the following on 2/4/2007 1:10 AM:
Is there a way to detect a held-down button while
the mouse is moving?
onmousedown and onmouseup

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 3 '07 #2
Thanks.

How does onmousedown and up helps?

Don't they cancel out each other?

"Randy Webb" <Hi************ @aol.comwrote in message
news:q6******** ************@te lcove.net...
Eric Layman said the following on 2/4/2007 1:10 AM:
>Is there a way to detect a held-down button while
the mouse is moving?

onmousedown and onmouseup

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 3 '07 #3
onmousedown tells you when they started holding the mouse button down.

The time between onmousedown and onmouseup is the time that the user
is holding the mouse down.

When onmouseup is called, it means the user has let go of the mouse.

Feb 3 '07 #4
Eric Layman said the following on 2/4/2007 2:58 AM:

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Thanks.

How does onmousedown and up helps?
It tells you when they hold the mouse down.
Don't they cancel out each other?
No. The onmousedown gets triggered, they drag the mouse, the mouse is
released and the onmouseup gets triggered.

onmousedown="va r mouseIsDown=tru e"
onmousedown="va r mouseIsDown=fal se"

And then when the mouse is being dragged/moved, you check the state of
mouseIsDown.

Your posting agent is severely broken.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 3 '07 #5

"Randy Webb" <Hi************ @aol.comwrote in message
news:et******** ************@te lcove.net...
Eric Layman said the following on 2/4/2007 2:58 AM:

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
>Thanks.

How does onmousedown and up helps?

It tells you when they hold the mouse down.
>Don't they cancel out each other?

No. The onmousedown gets triggered, they drag the mouse, the mouse is
released and the onmouseup gets triggered.

onmousedown="va r mouseIsDown=tru e"
onmousedown="va r mouseIsDown=fal se"

And then when the mouse is being dragged/moved, you check the state of
mouseIsDown.

Your posting agent is severely broken.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/
Thanks for the advice!

Here's the script I've conjured based on your tips!

My idea is to have multiple selection of table cells if user holds the mouse
down and "drags" the mouse over other cells.

But now I have problem with "deselectin g" the selected cells. My logic seems
flawed here. (yes i know the html is malformed. i just wanna test out the
idea =) )

Any comments?

<script language="javas cript">
var mouseIsDown = false;

function md()
{
mouseIsDown = true;
}

function mu()
{
mouseIsDown = false;
}

function check(cid)
{
var obj;
obj = document.getEle mentById(cid);
if(mouseIsDown)
{
if(obj.getAttri bute('bgColor') =="blue")
{
obj.getAttribut esetAttribute(' bgColor','white ');
}
else(obj.getAtt ribute('bgColor ')=="white")
{
obj.setAttribut e('bgColor','bl ue');
}
}
}
</script>
<body id="b1" >
<table width="100%" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td id="d1" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d1');">&nb sp;</td>
<td id="d2" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d2');">&nb sp;</td>
</tr>
<tr>
<td id="d3" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d3');">&nb sp;</td>
<td id="d4" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d4');">&nb sp;</td>
</tr>
<tr>
<td id="d5" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d5');">&nb sp;</td>
<td id="d6" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d6');">&nb sp;</td>
</tr>
<tr>
<td id="d7" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d7');">&nb sp;</td>
<td id="d8" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d8');">&nb sp;</td>
</tr>
<tr>
<td id="d9" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d9');">&nb sp;</td>
<td id="d10" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d10');">&n bsp;</td>
</tr>
<tr>
<td id="d11" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d11');">&n bsp;</td>
<td id="d12" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d12');">&n bsp;</td>
</tr>
<tr>
<td id="d13" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d13');">&n bsp;</td>
<td id="d14" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d14');">&n bsp;</td>
</tr>
<tr>
<td id="d15" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d15');">&n bsp;</td>
<td id="d16" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d16');">&n bsp;</td>
</tr>
<tr>
<td id="d17" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d17');">&n bsp;</td>
<td id="d18" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d18');">&n bsp;</td>
</tr>
</table>
</body>

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 3 '07 #6

"Eric Layman" <erricson@laysw rote in message
news:11******** ******@sp6iad.s uperfeed.net...
>
"Randy Webb" <Hi************ @aol.comwrote in message
news:et******** ************@te lcove.net...
>Eric Layman said the following on 2/4/2007 2:58 AM:

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
>>Thanks.

How does onmousedown and up helps?

It tells you when they hold the mouse down.
>>Don't they cancel out each other?

No. The onmousedown gets triggered, they drag the mouse, the mouse is
released and the onmouseup gets triggered.

onmousedown="v ar mouseIsDown=tru e"
onmousedown="v ar mouseIsDown=fal se"

And then when the mouse is being dragged/moved, you check the state of
mouseIsDown.

Your posting agent is severely broken.

--
Randy
Chance Favors The Prepared Mind
comp.lang.java script FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/

Thanks for the advice!

Here's the script I've conjured based on your tips!

My idea is to have multiple selection of table cells if user holds the
mouse down and "drags" the mouse over other cells.

But now I have problem with "deselectin g" the selected cells. My logic
seems flawed here. (yes i know the html is malformed. i just wanna test
out the idea =) )

Any comments?

<script language="javas cript">
var mouseIsDown = false;

function md()
{
mouseIsDown = true;
}

function mu()
{
mouseIsDown = false;
}

function check(cid)
{
var obj;
obj = document.getEle mentById(cid);
if(mouseIsDown)
{
if(obj.getAttri bute('bgColor') =="blue")
{
obj.getAttribut esetAttribute(' bgColor','white ');
}
else(obj.getAtt ribute('bgColor ')=="white")
{
obj.setAttribut e('bgColor','bl ue');
}
}
}
</script>
<body id="b1" >
<table width="100%" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td id="d1" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d1');">&nb sp;</td>
<td id="d2" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d2');">&nb sp;</td>
</tr>
<tr>
<td id="d3" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d3');">&nb sp;</td>
<td id="d4" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d4');">&nb sp;</td>
</tr>
<tr>
<td id="d5" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d5');">&nb sp;</td>
<td id="d6" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d6');">&nb sp;</td>
</tr>
<tr>
<td id="d7" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d7');">&nb sp;</td>
<td id="d8" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d8');">&nb sp;</td>
</tr>
<tr>
<td id="d9" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d9');">&nb sp;</td>
<td id="d10" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d10');">&n bsp;</td>
</tr>
<tr>
<td id="d11" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d11');">&n bsp;</td>
<td id="d12" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d12');">&n bsp;</td>
</tr>
<tr>
<td id="d13" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d13');">&n bsp;</td>
<td id="d14" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d14');">&n bsp;</td>
</tr>
<tr>
<td id="d15" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d15');">&n bsp;</td>
<td id="d16" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d16');">&n bsp;</td>
</tr>
<tr>
<td id="d17" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d17');">&n bsp;</td>
<td id="d18" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d18');">&n bsp;</td>
</tr>
</table>
</body>
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
An amended version. finally got de-selection to work:

<script language="javas cript">
var mouseIsDown = false;

function md()
{
mouseIsDown = true;
}

function mu()
{
mouseIsDown = false;
}

function check(cid)
{
var obj;
obj = document.getEle mentById(cid);
var bgc = obj.getAttribut e('bgColor');
if(mouseIsDown= =true)
{
if(bgc=="")
{
obj.setAttribut e('bgColor','bl ue');
}
else
{
obj.setAttribut e('bgColor','wh ite');
}
}
}
</script>
<body id="b1">
<div onMouseUp="mu() ;">
<table width="100%" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td id="d1" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d1');">&nb sp;</td>
<td id="d2" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d2');">&nb sp;</td>
</tr>
<tr>
<td id="d3" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d3');">&nb sp;</td>
<td id="d4" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d4');">&nb sp;</td>
</tr>
<tr>
<td id="d5" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d5');">&nb sp;</td>
<td id="d6" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d6');">&nb sp;</td>
</tr>
<tr>
<td id="d7" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d7');">&nb sp;</td>
<td id="d8" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d8');">&nb sp;</td>
</tr>
<tr>
<td id="d9" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d9');">&nb sp;</td>
<td id="d10" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d10');">&n bsp;</td>
</tr>
<tr>
<td id="d11" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d11');">&n bsp;</td>
<td id="d12" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d12');">&n bsp;</td>
</tr>
<tr>
<td id="d13" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d13');">&n bsp;</td>
<td id="d14" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d14');">&n bsp;</td>
</tr>
<tr>
<td id="d15" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d15');">&n bsp;</td>
<td id="d16" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d16');">&n bsp;</td>
</tr>
<tr>
<td id="d17" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d17');">&n bsp;</td>
<td id="d18" onMouseDown="md ();" onMouseUp="mu() ;"
onMouseOver="ch eck('d18');">&n bsp;</td>
</tr>
</table>
</div>
</body>

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 3 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
8658
by: David Jubinville | last post by:
Hi All, I've run into a bit of an interesting problem with CSS and font DPI and would certainly welcome help. Problem: Page layout defined in CSS has font size issues (overlapping frames, text overflowing out of popup window, etc) on a windows systems using 120dpi fonts (large fonts), but everything looks perfect in 96dpi small fonts.
1
1236
by: Claude Vernier | last post by:
Hi, I already got a nice Web application running and need to adapt it for iPaqs, Smartphone and Blackberry. Can you suggest a better newsgroup if any and some links to find best practices and help on how to start ?? Among questions: - I want the Default.aspx from the main site to redirect if Windows CE is
10
5114
by: florian | last post by:
Hi, we have a contention problem because of an application which tries to insert a duplicate row in a table with primary key. This insert fails of course but the locks are not released within this transcation. Why DB2 does not release the X lock after a failed insert??? We use DB2 UDB EEE Version 7.2 Fixpak 9, but we also can reproduce the Problem on DB2 UDB ESE 8.1 Linux Fixpak 4.
4
5804
by: sanjana | last post by:
hi can anyone help me with this i want to write a code in c#.net which detects usb storage and media card insertion can anyone help me with this?? thanx
0
2087
by: andrew | last post by:
We are currently writing a utility to audit software and hardware within computers on a network. We need to be able to access the the memory SPD data via the SMBus. This will tell us the manufacturer, serial number, speed, size, etc. We have the full spec for the SPD data, but cannot find anywhere the address within the SMBus that the SPD data is held, nor how to access the SMBus (preferably from C#). There are a number of utilities that...
2
3380
by: Hank | last post by:
Hello, Does anyone have a formula for calculating the number of days a stock was owned? Of course its real easy if you buy 100 shares on April 1 and sell 100 shares on July 1 but what about multiple buys and sells of different number of shares. As an example: Buy 100 April 1, Buy 200 May 1, Sell 50 June 1, Sell 250 July 1. For tax purposes we need to know the average number of days the stock was held. In the calculation, I believe...
16
4400
by: google | last post by:
Hello, I am working on an Acc2003 app for my company. In the interest of reducing chances of corruption due to unstable network connectivity, I would like to either prevent users from running it through a wireless connection, or limit their use to read-only. I have absolutely no idea if this is possible, and if so, how. Is there any way from within Access to get the list of routers they are connecting through? Ideally, I'd like to keep...
7
9753
by: Parv | last post by:
I am impersoanting a user to an other domain. But while doing so i am getting A required privilege is not held by the client exception. I have tried with aal possible usernames and passwords but didn't get success. I am getting same error if i am enetring blank user and password. What i am doing wrong ?
1
2890
by: shenanwei | last post by:
I have db2 v8.2.5 on AIX V5.3 with all the switches on Buffer pool (DFT_MON_BUFPOOL) = ON Lock (DFT_MON_LOCK) = ON Sort (DFT_MON_SORT) = ON Statement (DFT_MON_STMT) = ON Table (DFT_MON_TABLE) = ON Timestamp (DFT_MON_TIMESTAMP) = ON Unit of work ...
7
2794
by: Adam Benson | last post by:
Hi, We have a multi-threaded app, which has a windows form front end. We think we have been pretty careful to ensure that nothing but the UI thread alters controls on the form. But we've started experiencing lock ups. Of course, there could be any one of a number of causes but we wonder if one of our developers has been a little bit careless about using InvokeRequired and BeginInvoke.
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.