paladin-t / my_basic

A lightweight BASIC interpreter written in standard C in dual files. Aims to be embeddable, extendable and portable.
http://paladin-t.github.io/my_basic/
MIT License
509 stars 117 forks source link

Input Touch events from my tablet screen #45

Closed mayorb26 closed 3 years ago

mayorb26 commented 3 years ago

Hello, is it possible to implement the touch event from my tablet touchscreen, from my tablet in to touch basic like the "input" - command, or Is there an command already implemented, and if, what is its name, and how can I find it?

Thanks a lot for give me the possibility to asc about this

paladin-t commented 3 years ago

Hi,

MY-BASIC is designed to be a generic lib embedded in other projects, the lib itself doesn't offer any platform-dependent features.

The input is redirectable by assigning a custom handler via mb_set_inputer, as well as print via mb_set_printer.

mayorb26 commented 3 years ago

Hello Wang,

Thanks a lot for your time, and for your replie.

If I understand you right, there are already the possibilities to take imputs from devices embedded in your system, and I must only select the type of Imputdevice. This is wonderful......

OK, can yo send an example for MI case? Because I am in the beginning of learning, but for make a program I need the Imputs, for playing with them, and learn a little bit from this....

I hope this cuestión do not disappoint you...

My Englisch is so bad, excuse me so much.....

Thanks a lot

Greetings

Scott

Tony Wang @.***> schrieb am Do., 18. Nov. 2021, 03:08:

Hi,

MY-BASIC is designed to be a generic lib embedded in other projects, the lib itself doesn't offer any platform-dependent features.

The input is redirectable by assigning a custom handler via mb_set_inputer, as well as print via mb_set_printer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paladin-t/my_basic/issues/45#issuecomment-972567027, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2YXCO5X7Q6R3JCLXJTFM3UMSJ4TANCNFSM5IHZYDKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

paladin-t commented 3 years ago

Please see Redirecting-PRINT-and-INPUT for usage. It requires you to write your own input/output implementation for the specific platform. Then MY-BASIC will call the entries for input, print in BASIC instead of via standard console.

No problem, I'm neither a native english speaker. Feel free if there's any trouble using the lib.

mayorb26 commented 3 years ago

Why it is no possible for you the programmers in the whole earth to bring out something like : "kbd = keyboard" or " kbd = touchscreen touched 2times in x200y100" or "mouse = x1-x100y200" (this is only an example to make it shorter) (to explain what I mean)

With this I can work, and this is short an easy to understand for idiots like I am one of this,.... That's the problem of all the new programing languages, it is to much code, or coding for a simple thing like a mouse click or an touchevent from an touchscreen.... Or a keyboard input event.... Is not meant as offense to you, but to explain the problem for all the people what will learn a programming language.

If I can and if it's OK for you, then I have an big amount of ideas to share with you, if you want....

Greetings mi friend

Scott

Tony Wang @.***> schrieb am Do., 18. Nov. 2021, 09:42:

Please see Redirecting-PRINT-and-INPUT https://github.com/paladin-t/my_basic/wiki/Redirecting-PRINT-and-INPUT for usage. It requires you to write your own input/output implementation for the specific platform. Then MY-BASIC will call the entries for input, print in BASIC instead of via standard console.

No problem, I'm neither a native english speaker. Feel free if there's any trouble using the lib.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paladin-t/my_basic/issues/45#issuecomment-972831013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2YXCILL4GC6V6QPUC7ETTUMTYCDANCNFSM5IHZYDKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

iUltimateLP commented 3 years ago

Because a whole system isn't just as easy as you'd like it unfortunately. It is indeed very intimidating for beginners, but you need to understand that a touchscreen for example is not just a touchscreen.

It depends on what device, what touch panel, what coordinate system, what screen size, what driver is used to receive messages from a touch screen, whether we need to constantly fetch for new data ourselves or whether there is a event system, and so on and so on.

And if you look at languages / frameworks that were made for applications that you're requesting, e.g. Apples UI framework or Android, you'll see that they have almost simple touchscreen functionality. my_basic though is not, and never was meant to be a full replacement for these kind of frameworks, but rather a simple language. The language implements a few hooks and possibilities to get you started and to make the core of the language working (speaking about very basic features like variables, if clauses, etc.), so then, technically everything could be built on that.

The difference is:

my_basic could do all that technically, but that's why it's Open source. No one has done it yet, because it's a lengthy and rather difficult task, even for skilled programmers. And doing that unpaid - oh well ^^

mayorb26 commented 3 years ago

Johnny @.***> schrieb am Do., 18. Nov. 2021, 16:19:

Because a whole system is just as easy as you'd like it unfortunately. It is indeed very intimidating for beginners, but you need to understand that a touchscreen for example is not just a touchscreen.

In this therm you are totally right, but I think you understand my problem.... I agree with you totally, but how we can change that?

It depends on what device, what touch panel,

what coordinate system,

what screen size,

For this in the old qbasic was present the two commands to determine this, "window" and "screen"

And there we have the problem, no programmer has implemented the idea in the new programing languages...

what driver is used to receive messages from a touch screen,

whether we need to constantly fetch for new data ourselves or whether there

is a event system, and so on and so on.

I know, and I will help to solve this...

And if you look at languages / frameworks that were made for applications that you're requesting, e.g. Apples UI framework or Android,

you'll see that they have almost simple touchscreen functionality.

It's possible to implement things like this in your programmingtool (simplifyed?) (more understandable for people like me) pleeeease...

my_basic though is not, and never was meant to be a full replacement for these kind of frameworks,

I will it simple like your tool, I like your tool wery much, it is straight that what I search, but with the possibility to simply implement touchevents. But with no more Funktions like that, and only that, because all other Funktions that are present in other apps or tools, like Funktions for arduino, or other sh... (you know what I mean) all this other Funktions are not important for me, or the other tausends beginners like me... We will only the simplest Funktions.... And I think the others are also thankful that you think in a simple and little solution that it's good to understand like your tool...

And I will use mi time to se how your tool it's working, and I will provide you with informations if I have an idea to optimize your tool..... Or... To simplify it better... that you can proceed in the way that you want.... Because you are one of the people that understand what is really needed...

but rather a simple language. The language implements a few hooks and possibilities to get you started and to make the core of the language working (speaking about very basic features like variables, if clauses, etc.), so then, technically everything could be built on that.

The difference is:

  • Language (what my_basic is) = declares the syntax, basic features like memory management, variables, etc.
  • Framework (what Android e.g. is) = a whole big piece of software which makes use of the language and implements thousands of functions that do all various tasks.

And I do not need this thousands of Funktions, because this I am so interested in helping you with optimizing your tool...

my_basic could do all that technically, but that's why it's Open source. No one has done it yet, because it's a lengthy and rather difficult task, even for skilled programmers. And doing that unpaid - oh well ^^

Yes I know this and I am wery thankful for your efforts to create any thing that it's wery important and needed for beginners... Please don't stop doing what you do.

Best regards

Scott

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paladin-t/my_basic/issues/45#issuecomment-973180521, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2YXCMDCWKVBNBPUBH2U2DUMVGUPANCNFSM5IHZYDKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

paladin-t commented 3 years ago

Scott, don't want to disappoint you, but I have no plan to introduce touch, mouse, keyboard, GPU or any other platform-dependent/hardware-dependent features into the repo. Just as what Johnny has explained, MY-BASIC's goal is to provide core functionalities. It is supposed to be more generic and extensible rather than full featured across platforms. Similar to languages like Lua, Wren and many others. It will never be Python, even Python doesn't implement everything itself, it relies user extensions.