Tablet gesture

  • #1, by mzidangameWednesday, 23. December 2015, 12:19 6 years ago
    What is the 'right click' tablet gesture?

    Newbie

    9 Posts


  • #2, by SimonSSunday, 27. December 2015, 19:44 6 years ago
    Who rightclicks on a tablet ? It would be better to change the interface accordingly.

    Thread Captain

    1534 Posts

  • #3, by mzidangameSunday, 27. December 2015, 20:23 6 years ago
    Could you direct me to a script which allows to drag an item by holding the left mouse button, and to drop/release it on release?
    and perhaps another script to release a dragged item by simply holding the left mouse button?

    Newbie

    9 Posts

  • #4, by SimonSSunday, 27. December 2015, 20:37 6 years ago
    Wrote one some time ago, don't know if it works well:

    -- Simple Drag And Drop Handler
    -- (c) Simon Scheckel 2015
    
    local state_mousedown = false
    function dragDropHandler(eventType, mousePosition)
      if eventType == eEvtMouseLeftButtonUp or eventType == eEvtMouseLeftButtonHold then
    --	generateEvent(eEvtMouse)
    	state_mousedown = false
      elseif eventType == eEvtMouseLeftButtonDown then
    	state_mousedown = true
    	if game.CurrentObject:getId().tableId == eObjects and game.CurrentObject.IsItem then
     		game.UsedItem = game.CurrentObject
    	        game.UsedItemPicked = true
    	end
      elseif eventType == eEvtMouseMove and state_mousedown == false then
     	game.UsedItem = emptyObject
            game.UsedItemPicked = false
      elseif eventType == eEvtMouseMove  then
    	if game.UsedItem:getId().id ~= -1 and game.CurrentObject:getId().tableId == eObjects then
    --		setCursorPos(game.CurrentObject.Polygon[1])
    	end
      end
    end
     
    registerEventHandler("mouseEvent", "dragDropHandler", { eEvtMouseLeftButtonUp, eEvtMouseLeftButtonDown, eEvtMouseMove, eEvtMouseLeftButtonHold})
    

    Thread Captain

    1534 Posts

  • #5, by mzidangameSunday, 27. December 2015, 21:32 6 years ago
    thanks

    Newbie

    9 Posts