Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
showkey
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
Ilvalle
Guru
Guru


Joined: 07 Mar 2005
Posts: 325
Location: Gallarate - ITALY

PostPosted: Wed Nov 30, 2005 10:59 pm    Post subject: showkey Reply with quote

Ciao, vorrei conoscere il codice dei tasti
del portatile, per interderci quelli vicino al tasto on-off.
Se li premo nn accade nulla, nemmeno se premo
il centrale. Il fatto che poi il centrale è preso dalla acpi
che genera poi i suoi eventi.

Come posso fare??

Paolo
Back to top
View user's profile Send private message
mordredP
Apprentice
Apprentice


Joined: 17 Oct 2005
Posts: 155
Location: bari.italy.€urope.earth

PostPosted: Wed Nov 30, 2005 11:15 pm    Post subject: Reply with quote

usa xev
_________________
People fall into 10 groups: those who know binary and those who don't
dosmary.netsons.org
01010110
Back to top
View user's profile Send private message
Ic3M4n
Advocate
Advocate


Joined: 02 Nov 2004
Posts: 3489
Location: Bergamo.

PostPosted: Wed Nov 30, 2005 11:16 pm    Post subject: Reply with quote

puoi utilizzare xev da console se i tasti sono riconosciuti come della tastiera. se sono gestiti dall'acpi come la quasi totalità dei portatili che ho visto li puoi trovare nei log dell'acpi.
Back to top
View user's profile Send private message
Ilvalle
Guru
Guru


Joined: 07 Mar 2005
Posts: 325
Location: Gallarate - ITALY

PostPosted: Thu Dec 01, 2005 8:48 am    Post subject: Reply with quote

Provo appena torno a casa, cmq avevo pensato di gestirli con l'acpi
ma viene "captato" 8O soltanto il tasto di spegnimento, per gli altri
nulla da fare.
Dimenticavo è un acer aspiere 2100

Paolo
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Thu Dec 01, 2005 10:52 am    Post subject: Reply with quote

Come detto credo che puoi fare il grab dei codici sono come eventi acpi.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
syntaxerrormmm
Guru
Guru


Joined: 17 Apr 2005
Posts: 449
Location: Romano di Lombardia - BG - ITALY

PostPosted: Thu Dec 01, 2005 10:57 am    Post subject: Reply with quote

Come suggerito, puoi usare xev per capire quale segnale arriva; se non dovesse funzionare o non ti dovessi trovare bene, prova showkey in console da root.

Se hai GNOME, è possibile definire scorciatoie di tastiera utilizzando il codice di questi tasti. Io ad esempio l'ho usato per aumentare e diminuire il volume master (visto che non ho un controllo hw). Se non usi GNOME, puoi provare ad usare hotkeys che è anche molto configurabile.

Ciao.
_________________
"Every rule can be broken, but no rule may be ignored."

Last.fm - Gentoo 2006.1 on:
Acer Aspire 1355LC - suspend2-sources-2.6.18-r3
IBM Thinkpad T30 - suspend2-sources-2.6.19-r3
Back to top
View user's profile Send private message
Ilvalle
Guru
Guru


Joined: 07 Mar 2005
Posts: 325
Location: Gallarate - ITALY

PostPosted: Thu Dec 01, 2005 10:58 am    Post subject: Reply with quote

Non conosco il termine "Grab" ma forse è proprio quello che voglio fare io.
Una volta che conosco il codice del tasto modifico il file ( QUALE ? )
in [...]/keymaps. Ed eseguo un determinato script.
Credo poi sia quello che fa con il tasto centrale l'acpi.
Nn ho ancora provato non sono casa.

Paolo
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Thu Dec 01, 2005 11:07 am    Post subject: Reply with quote

Ilvalle wrote:
Non conosco il termine "Grab" ma forse è proprio quello che voglio fare io.
Una volta che conosco il codice del tasto modifico il file ( QUALE ? )
in [...]/keymaps. Ed eseguo un determinato script.
Credo poi sia quello che fa con il tasto centrale l'acpi.


Devi modificare i file che si trovano in /etc/acpi. Puoi cominciare a leggere:
Quote:

man acpid


e poi cercare su internet qualche esempio.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
Ilvalle
Guru
Guru


Joined: 07 Mar 2005
Posts: 325
Location: Gallarate - ITALY

PostPosted: Thu Dec 01, 2005 1:00 pm    Post subject: Reply with quote

Quote:
Come suggerito, puoi usare xev per capire quale segnale arriva; se non dovesse funzionare o non ti dovessi trovare bene, prova showkey in console da root.

Ho provato ma non cambia nulla.
Il programma xev si comporta precisamente come showkey, nel senso che non riceve i codici dei tasti.

Ho inserito nel file
Code:
/etc/acpi/default.sh

prima del case, la stringa
Code:
logger "Eseguito default.sh"

Ma nulla viene segnalato soltanto il tasto centrale.
Ultima
Code:
 showkey -s
kb mode was XLATE
forse può servire
Paolo
Back to top
View user's profile Send private message
Kind_of_blue
Guru
Guru


Joined: 10 Oct 2004
Posts: 485

PostPosted: Thu Dec 01, 2005 10:35 pm    Post subject: Reply with quote

io ho usato questo ... è in portage:

Quote:
* app-laptop/acerhk
Latest version available: 0.5.22
Latest version installed: [ Not Installed ]
Size of downloaded files: 29 kB
Homepage: http://www.informatik.hu-berlin.de/~tauber/acerhk/
Description: Hotkey driver for some Acer and Acer-like laptops
License: GPL-2


EDITO ... aggiungo i dettagli:
Quote:
zmore /usr/share/doc/acerhk-0.5.22/README.gz
------> /usr/share/doc/acerhk-0.5.22/README.gz <------

What is this driver good for?
*****************************

This driver will give access to the special keys on notebooks of the
Acer Travelmate series, which are not handled by the keyboard
driver.
It also works on notebooks from other manufacturers (some Medion,
Fujitsu-Siemens, ...).

It also has some other related functionality (depending on the model):
- controlling LEDs (Mail, Wireless)
- enable/disable wireless hardware

Usage
*****

The driver provides a device /dev/misc/acerhk where you can access all
functions through IOCTL's, look into acerhk.h for their definitions.
I use devfs and don't care about the minor number. You may want to change
ACERHK_MINOR in acerhk.h.
If you don't use devfs you need to create the device node. The device uses
major 10 (misc character devices), the minor is chosen by the kernel (if
ACERHK_MINOR equals MISC_DYNAMIC_MINOR) or by yourself (any other value).
Use something like
mknod /dev/acerhk c 10 123
to create the device node.
You can also use most functions through procfs. You will find three files in
/proc/driver/acerhk:
led - write "on" or "off" to set the led state
key - read it to get a key press, only useful on non-dritek models
and only if polling is disabled
info - some information about the driver, including the number of
pending keys
wirelessled - write "on" or "off" to set the led state and enable
wlan hardware
blueled - write "on" or "off" to set the led state and enable
bluetooth hardware
write a value n >= 50 to led the led blink every n jiffies

Probably the best way to use the driver is to let it poll for the keys itself
and generate real key events. this is the normal case when loading the module
without an additional parameter :

modprobe acerhk

or you can use the ioctl as specified in acerhk.h to control the polling. If
your kernel has keyboard input support you will get real key events when
pressing the special keys.
You can then use whatever software you like to make use of those keys,
i.e. 'hotkeys' or Linux Easy Access Keyboard 'lineakd'. I prefer hotkeys, just
in case anyone is interested, you can find a sample configuration for this
programm in doc/acertm.def.
Gnome >= 2.4 has built in support for multimedia keys (acme), that's
what I use now.

Have a look at
http://mmkc.sourceforge.net/

Note: If you have one of the newer models using dritek hardware you don't need
polling (nor the file /proc/driver/acerhk/key) to use your buttons. On this
hardware the driver only needs to send a special command to the keyboard
controller to make them work. The actual key presses are then handled by the
normal keyboard driver of the kernel. You can switch of polling by
loading the module with poll=0. It saves you precious cpu time.


Module parameters
*****************
name values meaning
autowlan 0,1 disable(default)/enable automatic switching of wlan hardware
on wireless keypress, only useful for older (no
dritek-hardware) models, works only will poll=1
poll 0,1 disable/enable(default) kernel polling of key events
verbose 0-4 verbosity level, see below
usedritek 0,1 disable/enable(default) use of dritek hardware on newer
series, needed to activate the keys on such models
force_series set this to the laptop series number you want the driver to
assume, skip autodetection (look at function
setup_model_features() for possible values)

Debugging
*********

You can make the the driver be more verbose. To do this, add the following
parameter when loading the module:

verbose=<n>

n is an integer, 0 (default) means no additional information while increasing
values provide an increasing amount of information. Currently 3 is maximum,
bigger values will have the same effect as 3. The existing verbosity levels
will generate information about:
Level Information
1 state changes and variable initialization
2 model probing
3 key translation, only known keys
4 key translation, also unknown keys
5 misc. information (idle values)

If you have rather serious problems you can activate debugging functionality
in the driver. To do this, uncomment the '#define ACERDEBUG' in acerhk.c. You
will find a new file in /proc/driver/acerhk, named 'debug'. You cannot read
from this file, but you can write commands consisting of up to 4 digits. The
first one specifies the action, while the latter can give additional
parameters. Implemented are:
'd' decrement module usage counter
'i' increment module usage counter

'p' call function pbutton_fct()
't' call function get_thermal_event()
'w1x' call function wbutton_fct_1() with parameter x (0-9)
'w2x' call function wbutton_fct_2() with parameter x (0-9)

'vx' change verbosity level to x (0-9)

'mxyy' set mapping of key name x to key event yy (hex)
'sxx' send key event xx (hex) to input system
'Sxx' simulate acer key press with code xx (hex)

'e0' stop kernel polling
'e1' start kernel polling

Example:

1) echo d > /proc/driver/acerhk/debug

will decrement the usage counter, very useful if a program using the driver
segfaulted. This way you can still unload the driver.

2) echo v4 > /proc/driver/acerhk/debug

will set the verbosity level to maximum.

Keycodes
********

see doc/keycodes
Also see http://bernd-wurst.de/linux/tm800.php#mmkeys (only in german)

If you have one of the newer models with the dritek hardware, use kernel 2.6
and get (after enabling it) kernel messages of the form:

atkbd.c: Unknown key pressed (translated set 2, code 0xf4 on
isa0060/serio0).
atkbd.c: Use 'setkeycodes e074 <keycode>' to make it known.

then you should do exactly what your told. In this case you could do

setkeycodes e074 158

to map the button with scancode e074 (hex) to keycode 158 (decimal). To find
out the scancodes of the buttons either look into the kernel log or into the
file MMKEYBD.CFG of the windows launch manager package. There you should find
lines like this:

Key 1 = 1,E0,74,E0,F4,F500,P1
** ** **

The important information is marked in the example above. The numbers give the
scancode produced by the button which's name is given last.
The keycode you give as parameter to setkeycodes is one out of the header file
linux/input.h, in the example above the one for KEY_BACK.
Important note: I received mails from a number of people where setkeycodes
rejected keycodes above a certain value. This is caused by an outdated version
of setkeycodes, use a more recent one.
To ease the setup of keymappings for the newer series I will try to include
setup scripts for the different notebook series. If I have enough time to
spare I will perhaps expand the driver itself do to that.

How does it work?
*****************

The driver is based on the windows Me for series 610 driver and
resembles its structure and functionality.
Key presses are events, which are stored in a FIFO queue with 31
entries. You can access the event count via CMOS nvram, but the access to
the actual queue (and other functionality like switching the mail led) is
done through calling a system ROM function.
Upon loading the driver looks for this function, if it cannot find it,
loading aborts.
Newer Dritek Hardware:
Button handling is done entirely by the EC (environment controller) which
behaves like an extended keyboard controller. My driver only enables/disables
this extension.


Credits
*******

Leif Jensen, whose driver inspired me to do the probing stuff
http://www.math.columbia.edu/~jensen/linux/acertm/

Thanks to all who contributed patches to this driver or who just tried it out
on their laptops, without them it wouldn't support anything else but my
TM 613.

Contact
*******

If you have problems with the driver, please include the following information:
1. name of your laptop (e.g. Acer TM 4001)
2. content of /proc/driver/acerhk/info, if available
3. kernel output after loading the module with verbose=2

Email: Olaf Tauber <tauber@informatik.hu-berlin.de>

The latest version can be found here:

http://www.informatik.hu-berlin.de/~tauber/acerhk
Back to top
View user's profile Send private message
Ilvalle
Guru
Guru


Joined: 07 Mar 2005
Posts: 325
Location: Gallarate - ITALY

PostPosted: Fri Dec 02, 2005 8:32 am    Post subject: Reply with quote

Gran bel programma!!!
Non ho provato ancora molto:
ma
Code:
root@rella acerhk # cat /proc/driver/acerhk/info
Acer hotkeys version 0.5.22
Model(Type)     : Aspire 2010 BIO(Dritek)
request handler : 0xc00fdf16
CMOS index      : not available
kernel polling  : active
autoswitch wlan : disabled
use of Dritek EC: enabled

E' normale il "not available"

Grazie ancora
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Fri Dec 02, 2005 8:41 am    Post subject: Reply with quote

C'e' la possibilita' che siano gestiti in maniera particolare dal kernel. Per l'acer travelmate 803 ho letto che e' stata necessaria una patch diretta al kernel. Nel forum, se cerchi, troverai un rosso post di discussione e un grosso post di howto, piu' della documentazione nel wiki. Forse e' il tuo caso, controlla! :)
Federico
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
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