Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Tablet gesture

  • #1, by mzidangame 11 years ago Zitieren
    What is the 'right click' tablet gesture?
  • #2, by SimonS 10 years ago Zitieren
    Who rightclicks on a tablet ? It would be better to change the interface accordingly.
  • #3, by mzidangame 10 years ago Zitieren
    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?
  • #4, by SimonS 10 years ago Zitieren
    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})
    
  • #5, by mzidangame 10 years ago Zitieren
    thanks