Author Topic: Ndless 2.0 for TI-Nspire Clickpad/Touchpad  (Read 181930 times)

0 Members and 1 Guest are viewing this topic.

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #480 on: March 04, 2011, 01:10:04 pm »
Yes it works now :)

And I think calc84maniac means the middle of the touchpad which can be "pressed down" like a normal button.

Offline some1specia1

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 5
  • Rating: +0/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #481 on: March 04, 2011, 01:14:32 pm »
I am having trouble with the prebuilt version of ndless. It only installs on my calculator 50% of the time, and when it does work it pops up a message.

"error
This document format is not supported.
ndless installer.tns"

Once i hit okay for this message ndless works okay, I can play games or use programs even with that message that came up.

If this topic has already been discussed I would appreciate another pre-built version being uploaded until I can figure out how to do that myself.

Thanks

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #482 on: March 04, 2011, 01:31:34 pm »
What you describe is a long know error, basically everything works fine but this message.
And I think if ExtendeD knew what the cause is, he would upload a fixed version very quickly ;)
What model of nspire have you between as this error seems to appear never to some people but always to others, so knowing on which hardware the error appears may help to find it (that's what I think at least).




@ExtendeD

Touchpad works fine so far, exept two things.

1) RIGHTDOWN is mapped to LEFTUP
here is the corrected line:
Code: [Select]
case TPAD_ARROW_RIGHTDOWN:
return report.y <= touchpad_info.height/TPAD_RATIO && report.x >= (touchpad_info.width * (TPAD_RATIO - 1))/TPAD_RATIO;

2) I suppose that since you haven't a Touchpad, you aren't aware of the fact that the touchpad does not only "react" on "touch" but also to "press" on the nine areas.
Actually that's how it is most used in normal OS function, and I think it would be very tiresome to "touch" it when you only want to navigate through a menu etc.
Now the touch will be sure useful in future games but the press is what, as far as I can say, corresponds to the up,down,left etc. keys on the clickpad.
I barely got that line above done so I fear that I can't help there but it would be nice if you add a test for "touchpad pressed".
My proposal is that isKeyPressed() tests for press and a other separate function tests for touch and returns the cords. ( I think that's what touchpad_scan() does but I'm not yet so far in the code)
« Last Edit: March 04, 2011, 03:22:53 pm by shrear »

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #483 on: March 05, 2011, 02:52:42 am »
some1specia1: OK so it's still there. I'll try other fixes and let you test them if you can.

shrear: 1) thanks, I couldn't test this one.

My proposal is that isKeyPressed() tests for press and a other separate function tests for touch and returns the cords. ( I think that's what touchpad_scan() does but I'm not yet so far in the code)

Yes, that is the idea.
I'm not sure if "pressed" means report->contact = TRUE, or if it corresponds to a special threshold of report->proximity, so I don't know how to update ndless_tpad.tns to test it. For you would the sensibility of ndless_tpad.tns be a touched Touchpad or a pressed Touchpad?
Ndless.me with the finest TI-Nspire programs

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #484 on: March 05, 2011, 04:19:46 am »
Yes, that is the idea.
I'm not sure if "pressed" means report->contact = TRUE, or if it corresponds to a special threshold of report->proximity, so I don't know how to update ndless_tpad.tns to test it. For you would the sensibility of ndless_tpad.tns be a touched Touchpad or a pressed Touchpad?
The sensibility there is what I would call "touched",
if I make sure to only "press" it (just pressing it on the edges or in the middle with a pencil) , it doesn't even react.
EDIT: just noticed that the OS doesn't react either in that case...

EDIT2:
I tested a bit and I come to the following conclusion:
the touchpad is one key which can be "pressed", but it makes no difference where you press.
the "touch" is registered separate on the surface of this key, but only if the "key" is not pressed.

I believe that the OS if you press par example down, first registers the location where you touch while your pressure isn't yet high and then as soon as you have pressed it down the OS reacts like pressing the down key on the clickpad.
This would at least explain the following bug: if you press in a menu first down and then press very quickly up the OS reacts still as if you pressed down.(probably since he didn't have time to updated the "touched" location.)

This are now my wild guesses and I may be wrong, so everyone who has a touchpad, feel free to correct me if you think I'm wrong.
« Last Edit: March 05, 2011, 09:59:37 am by shrear »

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #485 on: March 05, 2011, 06:21:26 am »
Thank you for these details.
I have added a proximity bar at the top of the screen in ndless_tpad.tns. The vertical line shows the limit above which a "click" is reported by isKeyPressed().

Is the proximity correctly reported? Is the "touched"/"clicked" limit good for you? (it is the one defined by the Touchpad controller)
Ndless.me with the finest TI-Nspire programs

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #486 on: March 05, 2011, 07:05:43 am »
the limit seems to correspond to the point where the OS would actually start to display a mouse and not in any way, if "pressed" or not.
If it is good or not, depends directly from where you using it, for "porting" clickpad games it is probably low enough but I can easily think of scenarios where in may need more sensitivity.

But I think I have to take back
Quote
the "touch" is registered separate on the surface of this key, but only if the "key" is not pressed.
this misinterpretation origins from my habit to press the touchpad on its borders, where the proximity is much inferior to what it is half a mm more to the middle  (what probably also is the cause why isKeyPressed(***) sometimes didn't seem to work for me :( )
« Last Edit: March 05, 2011, 07:12:35 am by shrear »

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #487 on: March 05, 2011, 07:31:30 am »
touchpad_scan() let use should the proximity threshold adapted to the program. But the threshold displayed is currently used for isKeyPressed() (ie for clickpad/touchpad programs). Should I keep it as it is? Else how can we find this "pressed" limit?
Ndless.me with the finest TI-Nspire programs

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #488 on: March 05, 2011, 08:10:57 am »
dividing the threshold by two would make sure that the big majority of "presses" are registered, on the cost that miss-presses would be more likely (but still rare if the user hasn't a dexterity problem).

About the pressed limit: To me it doesn't seem as if "touchpad-pressed" is resolved over "proximity", but is reported separate
and that it is at the software to merge "pressed" and "touched at the left" to "pressed left"

at hackspire proximity is on bit 01,
bit 0A has as description,
Quote
1 if touchpad pressed down, 0 if not
could that bit therefore make the difference between touched and pressed?
« Last Edit: March 05, 2011, 08:11:38 am by shrear »

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #489 on: March 05, 2011, 08:46:53 am »
You're right, I didn't see it.
Ndless.me with the finest TI-Nspire programs

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #490 on: March 05, 2011, 03:41:06 pm »
I've noticed that the keypad_type is not updated when you hot-swap the keypad in an Ndless program.
I'm not saying it's a bug: Ndless is simply returning the type that was detected by the OS, and which is not updated anymore as interrupts are disabled.

But it might be usefull for some programs to be able to hot-swap the keypad while a Ndless program is running.


So, is there a way for a Ndless program to detect the current inserted keypad?
« Last Edit: March 05, 2011, 03:42:02 pm by critor »
TI-Planet co-admin.

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #491 on: March 06, 2011, 06:34:22 am »
A discussion about this was started here a while ago. I could indeed include hot keypad detection if anyone provides more info on it.
Ndless.me with the finest TI-Nspire programs

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #492 on: March 06, 2011, 07:59:14 am »
shrear, I have just updated libndls to use the "pressed" field returned by the touchpad controller (and the velocity fields are now also available with touchpad_scan()).
So isKeyPressed() should now react as expected, could you please confirm?
Ndless.me with the finest TI-Nspire programs

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #493 on: March 06, 2011, 08:15:36 am »
confirmed. Works excellent now. :)

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #494 on: March 06, 2011, 10:38:28 am »
Is there anythng to change in the Makefile or in the headers?

I cannot recompile code which did compile on the previous r369.
Error at linking time:
Code: [Select]
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: c:/ndless/sdk/bin/../lib\libndls.a(touchpad.o): Unknown mandat
ory EABI object attribute 44
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: failed to merge target specific data of file c:/ndless/sdk/bin
/../lib\libndls.a(touchpad.o)
collect2: ld returned 1 exit status
make: *** [mviewer.tns] Error 1

I didn't modify the code, and I've performed a "make clean"...



Edit: It doesn't seem to come from the makefile or from my code...
I cannot even recompile the samples.
Same kind of errors, which all seem to be related to the new libndls:
Code: [Select]
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: c:/ndless/sdk/bin/../lib\libndls.a(show_msgbox.o): Unknown man
datory EABI object attribute 44
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: failed to merge target specific data of file c:/ndless/sdk/bin
/../lib\libndls.a(show_msgbox.o)
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: c:/ndless/sdk/bin/../lib\libndls.a(sleep.o): Unknown mandatory
 EABI object attribute 44
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: failed to merge target specific data of file c:/ndless/sdk/bin
/../lib\libndls.a(sleep.o)
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: c:/ndless/sdk/bin/../lib\libndls.a(idle.o): Unknown mandatory
EABI object attribute 44
c:/program files/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none
-eabi/bin/ld.exe: failed to merge target specific data of file c:/ndless/sdk/bin
/../lib\libndls.a(idle.o)
collect2: ld returned 1 exit status
make: *** [particles.tns] Error 1
« Last Edit: March 06, 2011, 10:58:20 am by critor »
TI-Planet co-admin.