473,702 Members | 2,679 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 3553
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
8662
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
1237
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
5115
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
3381
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
4402
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
9757
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
2891
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
9234
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
9089
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...
1
8983
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6575
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
5907
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
4412
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
4667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2402
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.