onpointerdown event in activeX control

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tqphan
Posts: 26
Joined: 04 Mar 2019, 14:44

onpointerdown event in activeX control

30 Jun 2020, 19:07

I have the following html:

Code: Select all

<!DOCTYPE html>
<html>
<body>
<div id="target">
    Tap me, click me, or touch me!
</div>
<script>
var targetBox = document.getElementById("target");

targetBox.onpointerdown = handleDown;

function handleDown(evt) {
  var action;
 
  switch(evt.pointerType) {
    case "mouse":
      action = "clicking";
      break;
    case "pen":
      action = "tapping";
      break;
    case "touch":
      action = "touching";
      break;
    default:
      action = "interacting with";
      break;
  }
 
  targetBox.innerHTML = "<strong>Thanks for " + action + " me!</strong>";
  evt.preventDefault();
}
</script>

</body>
</html>

When I load it in IE11, it works as expected. When I load it with AHK ActiveX control, the onpointerdown event never fire.

Full AHK script:

Code: Select all

html =
(
<!DOCTYPE html>
<html>
<body>
<div id="target">
    Tap me, click me, or touch me!
</div>
<script>
var targetBox = document.getElementById("target");

targetBox.onpointerdown = handleDown;

function handleDown(evt) {
  var action;
 
  switch(evt.pointerType) {
    case "mouse":
      action = "clicking";
      break;
    case "pen":
      action = "tapping";
      break;
    case "touch":
      action = "touching";
      break;
    default:
      action = "interacting with";
      break;
  }
 
  targetBox.innerHTML = "<strong>Thanks for " + action + " me!</strong>";
  evt.preventDefault();
}
</script>

</body>
</html>

)
Gui, +Resize
Gui, Margin, 0, 0
Gui, Add, ActiveX, w700 h300 vWB, about:<meta http-equiv="X-UA-Compatible" content="IE=edge">
WB.document.write(html)
Gui, Show
Return

GuiSize:
   GuiControl, Move, WB, w%A_GuiWidth% h%A_GuiHeight%
   Return

GuiClose:
   ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: LAPIII, peter_ahk and 325 guests