0

I'm a teacher at a school which has an SmartBoard interactive whiteboard in each classroom. I'm trying to create a web application for kids to use that basically involves dragging and dropping various elements around a web page. I've actually already created one that works fine when used on a computer with a mouse. However, on the SmartBoard, the drag-and-drop really lags, and sometimes fails completely.

As far as I can tell, the whiteboard doesn't mimic the onmousedown capability, and instead all touches are interpreted as onclicks. Is there any way around this? I can't think of a way to implement drag-and-drop without using onmouseup and onmousedown, nor do I know of any way to make the whiteboard interpret the input differently.

The only way I can think of to get around this is to write the application in Java, since I know from experience this will work. However, it's obviously a lot more work, so I'd rather not do it if I don't have to.

David John Welsh
  • 1,564
  • 1
  • 14
  • 23
  • Why not attach the draggable item to your mouse cursor onclick, then wait for a second click event and drop it at the new location? – Kevin McTigue Oct 31 '11 at 14:33
  • Nice idea! The problem I was having when I posted this question has been solved, but I can see how I might make use of your suggestion in another project I'm working on. Cheers! – David John Welsh Nov 01 '11 at 05:28

1 Answers1

0

First thing I would do is log all the events that the smartboard allows you to register:

function log(e) {
  console.log(e.type, e.pageX, e.pageY, e);
}

document.addEventListener('mousedown',log,false);   
document.addEventListener('mousemove',log,false);
document.addEventListener('mouseup',log,false);

(console.log is native to Google Chrome, you may need to install plugins to other browsers.)

This will help you decide what to do. A possible solution would be to use a double click to trigger the start/stop of the dragging motion.

Benjie
  • 7,701
  • 5
  • 29
  • 44
  • That's a good idea. I'll see what I can find out. If I discover a solution I'll post it. – David John Welsh Oct 31 '11 at 23:29
  • Well, today when I went in to test which events were being captured, I was unable to recreate the problem despite using the same board. The page worked on the SmartBoard exactly like it works on a regular computer. I can only assume there must have been some unrelated issue yesterday that wasn't present today. I'm going to continue event testing anyway; hopefully it'll help me create better pages in the future. – David John Welsh Nov 01 '11 at 05:25
  • Perhaps a dodgy whiteboard pen that sometimes can't sustain a mouse press and hold? Anyway - good luck! :) – Benjie Nov 01 '11 at 08:16