Git Product home page Git Product logo

Comments (10)

Geequlim avatar Geequlim commented on August 12, 2024 1

Ok I will find time to fix this soon.

from ecmascript.

Geequlim avatar Geequlim commented on August 12, 2024

Does it works in GDScript ?

from ecmascript.

MichaelBelousov avatar MichaelBelousov commented on August 12, 2024

will confirm but it should (I know it worked in C#)

from ecmascript.

MichaelBelousov avatar MichaelBelousov commented on August 12, 2024

It does, I converted it like so:

extends Node2D

class_name A

func _input(evt):
  if evt.button_index == BUTTON_RIGHT and evt.is_pressed():
    print('right click!')
  if evt.button_index == BUTTON_LEFT && evt.pressed:
    print('left click!')

from ecmascript.

Geequlim avatar Geequlim commented on August 12, 2024

You'd better report in upstream why this is commented out.
https://github.com/godotengine/godot/blob/72d12289bb5e46ad2ec840a23a247f5690afb0d3/core/os/input_event.cpp#L539

from ecmascript.

MichaelBelousov avatar MichaelBelousov commented on August 12, 2024

great question...

from ecmascript.

MichaelBelousov avatar MichaelBelousov commented on August 12, 2024

the git blame says it was done 3 years ago when removing the input event from the variant type. I can try to find the original author of that change on discord and ask them

from ecmascript.

MichaelBelousov avatar MichaelBelousov commented on August 12, 2024

I haven't gotten a reply by private message, I'll ask in one of the chats and eventually move to an issue on the github if no one can answer.

from ecmascript.

MichaelBelousov avatar MichaelBelousov commented on August 12, 2024

On IRC Fales (the godot JavaScript backend maintainer) told me that is commented out because it is bound in the super class:

fales[m]
17:38:03
mikemikeb: I think because it's exposed in the superclass "InputEvent".
https://github.com/godotengine/godot/blob/72d12289bb5e46ad2ec840a23a247f5690afb0d3/core/os/input_event.cpp#L119

from ecmascript.

Geequlim avatar Geequlim commented on August 12, 2024

Thanks for your report. This issue is fixed by bedb532

from ecmascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.