https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    12/01/2022, 10:03 AM
    http://haxeui.org/builder/?b5c1ef21
  • i

    icy-zebra-52882

    12/01/2022, 10:26 AM
    I'll take a look
  • i

    icy-zebra-52882

    12/01/2022, 10:26 AM
    meanwhile I submitted a PR for the HTML5 pointer events change
  • i

    icy-zebra-52882

    12/01/2022, 10:27 AM
    I didn't take out some of the older chunks of redundant code, just commented them in case it broke something, but can't see anything going wrong with the test app
  • b

    bright-gpu-74537

    12/01/2022, 10:31 AM
    interesting... what is browser support like?
  • i

    icy-zebra-52882

    12/01/2022, 10:32 AM
    for the Pointer Events API you mean?
  • b

    bright-gpu-74537

    12/01/2022, 10:32 AM
    yeah
  • i

    icy-zebra-52882

    12/01/2022, 10:32 AM
    pretty much universal since something like Chrome 40
  • b

    bright-gpu-74537

    12/01/2022, 10:33 AM
    https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events
  • b

    bright-gpu-74537

    12/01/2022, 10:33 AM
    yeah, looks like its everywhere
  • i

    icy-zebra-52882

    12/01/2022, 10:33 AM
    https://caniuse.com/mdn-api_pointerevent
  • i

    icy-zebra-52882

    12/01/2022, 10:34 AM
    hell, even the older IE11 supports it
  • b

    bright-gpu-74537

    12/01/2022, 10:35 AM
    cool - well.. ill run your branch though component explorer and see how it fares
  • i

    icy-zebra-52882

    12/01/2022, 10:38 AM
    try it with the touch emulation in browser responsive modes if you don’t have a touch device to test with
  • i

    icy-zebra-52882

    12/01/2022, 10:39 AM
    I’ve no idea how mobile browsers simulate a right click, or if they even do, so I left it alone as a mouse event
  • b

    bright-gpu-74537

    12/01/2022, 10:40 AM
    press for a while i think... i think browsers are generally smart enough to send a right click if you press and hold... i think so anyway
  • i

    icy-zebra-52882

    12/01/2022, 10:42 AM
    there was a
    contextmenu
    event somewhere in the haxeui-html5 code, but had something else feeding it events, didn’t test changing it in case I broke something
  • b

    bright-gpu-74537

    12/01/2022, 10:45 AM
    ah, yeah, that might be it actually, its contextmenu rather than some discrete right click event
  • i

    icy-zebra-52882

    12/01/2022, 10:52 AM
    does that event also trigger for a mouse right click though?
  • b

    bright-gpu-74537

    12/01/2022, 10:53 AM
    yeah, i think so
  • b

    bright-gpu-74537

    12/01/2022, 10:54 AM
    i think thats the "trick"... ill have to take a look and see if thats the case.... cant remember off hand
  • b

    bright-gpu-74537

    12/01/2022, 10:54 AM
    but there is defo "right click" on haxeui-html5, but i think its something like that, ie, abuse context menu
  • i

    icy-zebra-52882

    12/01/2022, 11:03 AM
    hmm somewhere there's an invalid cast on my test app
  • i

    icy-zebra-52882

    12/01/2022, 11:06 AM
    I don't think the EventMapper MOUSE_TO_TOUCH and TOUCH_TO_MOUSE are necessary either if pointer events are being used
  • i

    icy-zebra-52882

    12/01/2022, 11:06 AM
    since under PE, they are all one type of pointer, just with extra possible fields set
  • i

    icy-zebra-52882

    12/01/2022, 11:31 AM
    is there a reason that (the HTML DOM event)
    MouseEvent.buttons
    is used over
    MouseEvent.button
    for handling mouse button presses?
  • i

    icy-zebra-52882

    12/01/2022, 11:32 AM
    https://api.haxe.org/js/html/MouseEvent.html#button this seems to line up better with the actual DOM event API for both Mouse Events and Pointer Events
  • i

    icy-zebra-52882

    12/01/2022, 11:33 AM
    Copy code
    0: Main button pressed, usually the left button or the un-initialized state
    1: Auxiliary button pressed, usually the wheel button or the middle button (if present)
    2: Secondary button pressed, usually the right button
    3: Fourth button, typically the Browser Back button
    4: Fifth button, typically the Browser Forward button
  • b

    bright-gpu-74537

    12/01/2022, 11:34 AM
    where is
    MouseEvent.buttons
    used?
  • i

    icy-zebra-52882

    12/01/2022, 11:36 AM
    it's used in ComponentImpl.hx:660 and ScreenImpl.hx:479
1...131113121313...1687Latest