FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

keyboard

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
carlitosk
Newbie


Joined: 04 Apr 2007
Posts: 3
Location: Argentina

PostPosted: Wed Apr 04, 2007 6:24 pm    Post subject: keyboard Reply with quote

hi i new on this. i want to create a script that allow me to press a key on the phone and send command to pc for example: press the 5 key in my cel phone and in the pc send the control key.. like i press the control key on my keyboard'. sorry mi english
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Apr 04, 2007 6:57 pm    Post subject: Reply with quote

You may want to look here:

http://www.salling.com/forums/viewtopic.php?t=2930

(this is the wrong area of the forums; the "search" function is also helpful...)

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
carlitosk
Newbie


Joined: 04 Apr 2007
Posts: 3
Location: Argentina

PostPosted: Wed Apr 04, 2007 7:44 pm    Post subject: Reply with quote

[quote="salling"]You may want to look here:

http://www.salling.com/forums/viewtopic.php?t=2930

(this is the wrong area of the forums; the "search" function is also helpful...)

Best.
--
Jonas[/quote]

Hi salling! sorry for post here, i seen your post yesterday, and i create a script but donīt work, i use the 2 commands. sendkeystroke and sendvirtualkeystroke, without results

This is what i got: (thks to you post)

var widget = CreateKeypadScreen( "mykeypad_" );
widget.title = "Keypad Sample";
widget.CreateRow( "Demo", scCenter, scClip, scLarge );
widget.CreateRow( "Use the d-pad", scCenter, scWrap, scMedium );
theTerminal.Push( widget );

function mykeypad_KeyDown(theScreen, theKey)
{
if( theKey == "s" ) {
// VK_LBUTTON (i try with the mouse button but didnīt work)
SendVirtualKeystroke( 0x01, false, false, false, false );
} else if( theKey == "v" ) {
// VK_DOWN
SendKeystroke( 0x28, false );
} else if( theKey == "^" ) {
// VK_UP
SendKeystroke( 0x26, false );
} else if( theKey == "<" ) {
// VK_LEFT
SendKeystroke( 0x25, false );
} else if( theKey == ">" ) {
// VK_RIGHT
SendKeystroke( 0x27, false );
} else if( theKey == "u" ) {
// VK_VOLUME_UP
SendKeystroke( 0xAF, false );
} else if( theKey == "d" ) {
// VK_VOLUME_DOWN
SendKeystroke( 0xAE, false );
} else if( theKey == "c" ) {
// VK_VOLUME_MUTE
SendKeystroke( 0xAD, false );
}

// Keep the keypad active
return true;
}
function mykeypad_KeyDown(theScreen, theKey)
{
ShowMessage( theKey );
return true;
}

I want to use the cel phone like a joystick, like this, i try with the mouse pointing scrit with FarCry game and its work, i want to remap keys to this graphic, is possible?

[img]http://img522.imageshack.us/img522/8728/60693035167175250x275gm4.jpg[/img]

Thanks a lot, and sorry again for my bad english.:!
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Apr 04, 2007 7:48 pm    Post subject: Reply with quote

Please read the red text in the post I linked to. The red color indicates that it's important.

This can be made to work, but I don't have the time to help you; others in this forum are killing me for not having 3.5 out yet.

- jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
carlitosk
Newbie


Joined: 04 Apr 2007
Posts: 3
Location: Argentina

PostPosted: Wed Apr 04, 2007 8:29 pm    Post subject: Reply with quote

[quote="salling"]Please read the red text in the post I linked to. The red color indicates that it's important.

This can be made to work, but I don't have the time to help you; others in this forum are killing me for not having 3.5 out yet.

- jonas[/quote]

Sorry again!.. i just want 1 example from you

I want to press the number 5 in my cel phone and i want to send the "A" Key, for example in Microsoft word writting, on my cel i press Number 5 and in word appears a "A" letter

if( theKey == "s" ) {
//
SendVirtualKeystroke( 0x41, false, false, false, false );

oR..

if( theKey == "s" ) {
//
SendUnicodeKeystroke( 41 );

Please.. just one example!
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Apr 04, 2007 8:47 pm    Post subject: Reply with quote

Sigh...

[quote]
PLEASE NOTE: The SendKeystroke() API used in the example below is retired as of 3.0.1. Instead, please use these:

To send a "character", use:
SendUnicodeKeystroke( unicode value );

To simulate the pressing of a specific key:
SendVirtualKeystroke(
virtual keycode value,
shiftState,
ctrlState,
altState,
winState);

(the "state" parameters are booleans)
[/quote]

Hence, I think this will work:

SendUnicodeKeystroke( 'A' );

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group