XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Jun 23日 12:40

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2015年 Dec 9日 06:25 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 480
To capture the use of the ctrl key whilst using the scrollwheel I would use the following javascript code. See the event keywords in the code sample below:

Code:
backplate.onMouseWheel = function (event) {
   var size = Number(preferences.scalePref.value),
        maxLength = Number(preferences.scalePref.maxLength),
        minLength = Number(preferences.scalePref.minLength),
        step = 10;

    if (event.ctrlKey) {
       if (event.scrollDelta > 0) {
           size += step;
           if (size > maxLength) {
               size = maxLength;
           }
       } else if (event.scrollDelta < 0) {
           size -= step;
           if (size < minLength) {
               size = minLength;
           }
       }
       preferences.scalePref.value = String(size);
       resize();
   }
};

What is the equivalent method to obtain the CTRL keypress within Xwidget?


Last edited by yereverluvinuncleber on 2017年 Jun 22日 01:02, edited 2 times in total.

Top
 Profile  
 
PostPosted: 2015年 Dec 9日 06:33 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4494
Check this widget and the script:
http://subhanulhaque.deviantart.com/art ... -339438490
This guy created a virtual keyboard..

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: 2015年 Dec 9日 07:17 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 480
Thanks Jim for the attempt to help.

Yes he did create a virtual keyboard but he didn't capture a CTRL key, his keyboard just has images that respond and add characters on a screen. There was no ctrl key and he didn't handle the event. Interesting widget though...


Top
 Profile  
 
PostPosted: 2015年 Dec 9日 07:42 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4494
I found this:
http://help.adobe.com/en_US/AS2LCR/Flas ... 00520.html

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: 2015年 Dec 9日 17:23 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 480
Let me see what I can do with it.


Top
 Profile  
 
PostPosted: 2015年 Dec 23日 16:27 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 480
It seems that you cannot capture keypress events when manipulating any object other than an text edit box or similar. This is a problem as it means that a press of the CTRL key when the mouse is over the widget cannot be captured even though we have an onKeyDown event set up and code assigned. The event is simply ignored.

I tested a very large edit box at an opacity of 1 that can be set over the whole widget, this would have allowed a CTRL key to be captured, unfortunately mouse-through does not seem to work with edit boxes so all other onMouse events for all other images sitting below are negated when a large edit box is positioned above them.

So, to sum up: Xwidgets has an incomplete implementation of onKeyDown event that does not currently function on image objects. This is a BUG. Changing the title of this thread to a BUG.


Top
 Profile  
 
PostPosted: 2017年 Apr 25日 05:23 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 480
BUMP:

This bug is a very serious one, it means that Xwidgets cannot respond to keypress events. That makes it useless for creating keyboard driven apps that respond to key events.

For example, when using youtube to display videos the spacebar, cursor and other keys can be used to control the video. These keypresses have become the standard for media players and allow the user to interact with the app using the keyboard if he wishes.

Xwidget does not allow this interaction due to a shoddy implementation of the keydown event.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group