i'm just a user of Xwidget and sharing my experience about it:
===================
FindOut Keyboard Key Codes:To use the keyboard keys you could use OnKeyDown Event; but it only works for Edit boxes for me when it has Typing focused to it
*Remember to use below code you should goto object edit1 and in Functions Tab set the OnKeyDown Function to edit1OnKeyDown
*and you need to create Text1 Object to see Output
Code:
function edit1OnKeyDown(Sender,Key,KeyChar,Shift)
{
text1.Text=Key
//to get Charecters Key(a,b,c,...) Output use [KeyChar] after equal (text1.Text=KeyChar)
//to get other Keys (Ctrl,alt,arrowkeys,winkey,...) Output use [Key] after equal (text1.Text=Key)
}
[text1] is name of object i create for test the Output
[KeyChar] & [Key] are variables in KeyDown Function that recieve Key Codes
===============
using Keyboard Key Codes:after you find out the key Output you could use it this way:
Code:
function edit1OnKeyDown(Sender,Key,KeyChar,Shift)
{
//Key Codes may be different for your keyboard so find it yourself
if(Key=="37") //37 is ArrowLeft //38 is ArrowUp //39 is ArrowRight //40 is ArrowDown
{
text1.Text="Hello World" //Replace this line with your own Commands [myimage.src = "image1.png";]
}
}
=========================
using Mouse Button Codes:you could use same way for Mouse Buttons plus you could use it for all objects
for this you should set OnMouseDown Function instead of OnKeyDown Function
and in the code you should use Button instead of Key
Code:
function edit1OnMouseDown(Sender,Button,Shift,X,Y)
{
//Key Codes may be different for your Mouse so find it yourself
if(Key=="2") //2 is MiddleButton //1 is RightButton //0 is LeftButton
{
text1.Text="Hello World" //Replace this line with your own Commands [myimage.src = "image1.png";]
}
}
=========================