Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

BB10 WW Native Extension - events not firing

Thanks in advance - I need a little help with something that should work but doesn't

 

I've finally got the hang of writing Native Extensions for WebWorks, my first is going in GitHub when my GitHub approval finally turns up.

 

That's the good news - now for the bad...

 

My first extension needs to capture events - its a Virtual Keyboard extension so I want to capture what the system does as well as open / close and change the layout

 

The non-event stuff works perfectly

 

The event loop is entered but I never get any events from the VK

 

The event loop uses a small modification of the standard for(;:smileywink: { ... } structure so the thread can do more than one thing (apparently we're only allowed one extra thread in a Native Extension)

 

The problematic code is on GitHub and starts at line #99 - the controlling function is at #140

 

The 100ms timeout on bps_get_event() causes vkHeight to increment at 10hz (a testing hack), this can be seen to be happening from the example app as the variable is exposed by VKgetHeight()

 

If the hack (#103) is moved down one line, inside the event handling code, it never gets to it.

 

i.e. if(event) { ... } must always be returning false

 

This is standard code from every event loop implementation I can find with my small modification being the only difference.

 

The webworks repo shows that a few BB extensions use events - the most complete one being BBM so it must be possible - it just ain't working and there is no obvious reason why it fails to work as it should




Click the like button if you find my posts useful!