XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 5:47 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: September 10th, 2012, 3:19 am 
Offline
User avatar

Joined: August 18th, 2012, 4:08 pm
Posts: 101
Location: Oradea, Bihor, Romania
Is there a way to create an event when a particular key is pressed? For example if the user presses F10 the script:
Code:
run("shutdown.exe -L");

_________________
" Homosexuality exists in 450 species. Homophobia is found in only one. Which seems unnatural now?
Image


Top
 Profile  
 
PostPosted: September 10th, 2012, 5:16 am 
Offline
User avatar

Joined: August 29th, 2012, 2:34 am
Posts: 56
I don't know how to capture the keyboard input once you had left you widget (im pretty sure xWidget dont support it). But if you will create a new Edit lets call it "editKey" and set the Visibility to false we can force it 8-) to act as a fake key capture (Because i didn't found any outer way to capture keyboard input, correct me here if im wrong). Se define a new function
Code:
function widgetOnEnter()
{
     editKey.SetFocus();
}

So each time the focus is set to the widget it immoderately activates the Edit box and from here just add to the "editKey" Edit a new function to capture keyboard events
Code:
function editKeyOnKeyDown(Sender,Key,KeyChar,Shift)
{
  print("Key:" + Key);
  print("KeyChar:" + KeyChar);
  print("Shift:" + Shift);
}

The key value for F10 is "121".

But as we all know there is no documentation for xWidget so there is a possible way to maybe somehow capture the keyboard while the widget on the background or else...

_________________
Image


Top
 Profile  
 
PostPosted: September 10th, 2012, 5:21 am 
Offline
User avatar

Joined: August 18th, 2012, 4:08 pm
Posts: 101
Location: Oradea, Bihor, Romania
It's not exactly what I wanted but it'll work for now. Thanks. Again. o.e You're a genius.

_________________
" Homosexuality exists in 450 species. Homophobia is found in only one. Which seems unnatural now?
Image


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users 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