Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Having a lot of problems finding the documentation (e.g. about sendevent)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kent Yip  
View profile  
 More options Apr 21 2009, 4:02 pm
From: Kent Yip <yes...@gmail.com>
Date: Tue, 21 Apr 2009 13:02:11 -0700
Local: Tues, Apr 21 2009 4:02 pm
Subject: Re: [android-beginners] Re: Having a lot of problems finding the documentation (e.g. about sendevent)

thank swarup for the insight

i was able to look at the events from emulator, the keycode i different than
defined in frameworks/base/core/java/android/view/KeyEvent.java

all i can say is keycode for emulator and real device maybe different.

and i am using SDK version: android-sdk-windows-1.1_r1

here is how to use: sendevent

command format: sendevent device type code value

[command]     [device]             [type]    [code]   [value]
sendevent    /dev/input/event0    1          229      1

/dev/input/event0 is the device to send it to

[type] 1 is unknow for me ( maybe code for physical button on device )

[code] 229 is the MENU button of the emulator

[value] 1 is keydown or press down ( for keyup or up use 0 )

i wrote a batch file for sending the event to the device like below:

adb -s emulator-5554 shell sendevent /dev/input/event0 1 229 1
adb -s emulator-5554 shell sendevent /dev/input/event0 1 229 0

have to use the follow command to simulate a pressing of button ( aka
pressing down then let go )

Key Name                 CODE
MENU                       229
HOME                       102
BACK (back button)    158
CALL (call button)       231
END (end call button)  107

now keyboard shown on the emulator

Key Name                 CODE
1                               2
2                               3
3                               4
4                               5
5                               6
6                               7
7                               8
8                               9
9                               10
0                               11
q                               16
w                               17
e                               18
r                                19
t                                20
y                               21
u                               22
i                                23
o                               24
p                               25
a                               30
s                               31
d                               32
f                                33
g                               34
h                               35
j                                36
k                               37
l                                38
DEL (delete key)        14
SHIFT (shift key)        42
z                               44
x                               45
c                               46
v                               47
b                               48
n                               49
m                              50
. (period)                    52
return (enter key)        28
Lt Alt (Left ALT key)    56
SYM                         127
@                             215
Spc (Space key)        57
/                               53
, (comma)                 51
Rt Alt (Right ALT key) 100
Pwr ( Power on/off )     116

On Tue, Apr 21, 2009 at 1:49 AM, swarup <me.s...@gmail.com> wrote:

> 1) study the output of 'adb shell getevent', get high level idea of
> different parameters of keyevent.
> 2) look at source code of getevent, sendevent command.
> 3) also another command might interest you: input

> P.S.: if you do not know the source code locations, then follow the
> below gitweb path:

> [platform/system/core.git] /toolbox/sendevent.c
> [platform/system/core.git] /toolbox/getevent.c
> [platform/frameworks/base.git] /cmds/input/src/com/android/commands/
> input/Input.java

> On Apr 20, 4:33 pm, a druid <klausf...@gmail.com> wrote:
> > Hi Kent,

> > Thanks for your answer.
> > I already saw the documentation for monkey.
> > However this presses keys randomly.

> > What I wanted to do is to programatically (via adb shell, or via a
> > service like vnc server for PCs) pressing non random keys.

> > The simple first example, that I'd like to try is:
> > press (and release) the up button once.

> > I did not find any pointers explaining how to do this:

> > There seems to be a adb-shell command named 'sendevent', but I found
> > no documentation at all about the
> > event types / event numbers etc, that I should provide.

> > On Apr 17, 7:08 pm, Kent Yip <yes...@gmail.com> wrote:

> > > Perhaps this link will get your started,
> http://developer.android.com/guide/developing/tools/adb.htmllookfor
> > > monkey.

> > > This link as wellhttp://
> developer.android.com/guide/developing/tools/monkey.html

> > > On Fri, Apr 17, 2009 at 8:53 AM, a druid <klausf...@gmail.com> wrote:

> > > > Hi,

> > > > Is it just me or is it really difficult to get information
> > > > about certain Android features?

> > > > Currently I wanted to understand, what exactly can be done with the
> > > > adb shell command 'sendevent'

> > > > I even fail performing a very simple test, which is to press a key in
> > > > the emulator.

> > > > For debugging and ome other purposes I would like to press keys and
> > > > perform touch screen events from the developing system and send them
> > > > to either the emulator or a device connected via the adb.

> > > > Somehow I am very unfortunate locating the adequate documentation.

> > > > Thanks in advance for a good place to start

> > On Apr 17, 7:08 pm, Kent Yip <yes...@gmail.com> wrote:

> > > Perhaps this link will get your started,
> http://developer.android.com/guide/developing/tools/adb.htmllookfor
> > > monkey.

> > > This link as wellhttp://
> developer.android.com/guide/developing/tools/monkey.html

> > > On Fri, Apr 17, 2009 at 8:53 AM, a druid <klausf...@gmail.com> wrote:

> > > > Hi,

> > > > Is it just me or is it really difficult to get information
> > > > about certain Android features?

> > > > Currently I wanted to understand, what exactly can be done with the
> > > > adb shell command 'sendevent'

> > > > I even fail performing a very simple test, which is to press a key in
> > > > the emulator.

> > > > For debugging and ome other purposes I would like to press keys and
> > > > perform touch screen events from the developing system and send them
> > > > to either the emulator or a device connected via the adb.

> > > > Somehow I am very unfortunate locating the adequate documentation.

> > > > Thanks in advance for a good place to start


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google