Author Topic: Sticky Keys doesn't work after update  (Read 1999 times)

rangerori

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 7
    • View Profile
Sticky Keys doesn't work after update
« on: February 20, 2014, 04:16:48 AM »
I used sticky and unsticky keys in my script, and now after the latest update (I installed on 20/02/14) it gives me errors:

  1. camera.stickyPress = false;

Error: stickyPress is read-only.

Well, I went to the documentation, and it seems like:
http://www.tasharen.com/ngui/docs/class_u_i_camera.html#a8774235a31517ef324469ba17ba52aec


This wasn't like this before the update, and it ruined my code.

Anyway to fix this???

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sticky Keys doesn't work after update
« Reply #1 on: February 20, 2014, 09:31:13 AM »
There are no sticky keys anymore. You have new events to work with now -- OnDragOver, OnDragOut. They eliminate the need for the functionality provided by sticky keys. Furthermore UIButton script was changed to use this new functionality and now have a "drag over" property that lets you change if they will get highlighted when you drag over them or not.

rangerori

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 7
    • View Profile
Re: Sticky Keys doesn't work after update
« Reply #2 on: February 20, 2014, 09:50:35 AM »
I'll tell you what is the problem with this new functionality.


Let's assume I have 4 clickable arrows:
------Up-------
Left--------Right
-----Down-----


These arrows are stationary, and I want to move my mouse while it is being pressed from one to another in order to activate each of these at each turn.

With Sticky Keys I could've done it, but I have no idea how can I implement it with the Drag functionality.. it drags an object, while I don't need to drag an object, but merely, to activate each of these arrows without lifting the mouse/touch from the surface...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sticky Keys doesn't work after update
« Reply #3 on: February 20, 2014, 09:56:09 AM »
You had your logic in OnPress before. Move it to OnDragOver instead. You get OnDragOver notification when you happen to drag something over -- you don't need to be actually dragging an object. Merely doing a drag operation. A drag operation is when you press on something, then start moving the finger. Moving the finger over some other widget will result in OnDragOver being fired for that widget, and OnDragOut for the previous.

rangerori

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 7
    • View Profile
Re: Sticky Keys doesn't work after update
« Reply #4 on: February 20, 2014, 10:14:15 AM »
Very well, I implemented it and it works great now. thanks! :)