tm2-2050 not working

Asked by Stephen Parry

Hi,
I can't get magick 1.3 working on tm2 2050 for love nor money. I'm running lucid, I've got hp-wmi loaded and running but when I swivel the screen hp_wmi_notify just does not seem to be getting called (I added some debug statements), although it does get called when the RF kill button gets pressed. When I check dmesg, the swivelling the screen generates these messages:
[ 894.401423] atkbd.c: Unknown key pressed (translated set 2, code 0xd8 on isa0060/serio0).
[ 894.401429] atkbd.c: Use 'setkeycodes e058 <keycode>' to make it known.
[ 894.415125] atkbd.c: Unknown key released (translated set 2, code 0xd8 on isa0060/serio0).
[ 894.415134] atkbd.c: Use 'setkeycodes e058 <keycode>' to make it known.
[ 895.195728] atkbd.c: Unknown key pressed (translated set 2, code 0xd9 on isa0060/serio0).
[ 895.195734] atkbd.c: Use 'setkeycodes e059 <keycode>' to make it known.
[ 895.209587] atkbd.c: Unknown key released (translated set 2, code 0xd9 on isa0060/serio0).
[ 895.209596] atkbd.c: Use 'setkeycodes e059 <keycode>' to make it known.

I did manage to get my own scripts to pick up these keystrokes, but I'd rather have magick do it.

I've tried the lucid release of hp-wmi and the last from the kernel trunk before they switch to sparse keymaps.

Am I missing something?
Thanks in advance
Stephen

P.S. I have BIOS revision F-12

Question information

Language:
English Edit question
Status:
Answered
For:
Magick Rotation Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jayhawk (the-ayuthias) said :
#1

The information that you are showing here are new key that have not been defined as of yet in the kernel. I think that you will need to do the setkeycodes command that is suggested and replace the <keycode> with another number (maybe 153).

The other thing that we will also need to check is /dev/input/hp-wmi and see if the symbolic link is there. If it is not there, you might need to check 'sudo lsinput' (the l is a lower-case L) and it will tell you which /dev/input/event it is. You might need to install input-utils if you have not already. We are looking for the event number that goes with the hp-wmi.

Once you fine the correct event value, we can then run some tests with 'sudo evtest /dev/input/eventX' (replace X with the correct value provided from lsinput).

Revision history for this message
Stephen Parry (sgparry) said :
#2

The symbolic link is in place and links to /dev/input/event8. (This is
is also confirmed in dmesg).
However, sudo evtest /dev/input/event8 shows *no* events at all when the
screen hinge is rotated.
sudo evtest /dev/input/event4 (the keyboard input device) shows the
events mentioned in the original post: two e058 events for swivelling
into tablet mode, two e059 events for returning to laptop mode.

On 07/02/11 17:40, Jayhawk wrote:
> Your question #144254 on Magick Rotation changed:
> https://answers.launchpad.net/magick-rotation/+question/144254
>
> Status: Open => Needs information
>
> Jayhawk requested for more information:
> The information that you are showing here are new key that have not been
> defined as of yet in the kernel. I think that you will need to do the
> setkeycodes command that is suggested and replace the <keycode> with
> another number (maybe 153).
>
> The other thing that we will also need to check is /dev/input/hp-wmi and
> see if the symbolic link is there. If it is not there, you might need
> to check 'sudo lsinput' (the l is a lower-case L) and it will tell you
> which /dev/input/event it is. You might need to install input-utils if
> you have not already. We are looking for the event number that goes
> with the hp-wmi.
>
> Once you fine the correct event value, we can then run some tests with
> 'sudo evtest /dev/input/eventX' (replace X with the correct value
> provided from lsinput).
>

Revision history for this message
Jayhawk (the-ayuthias) said :
#3

Thank you for checking into it for me. From what you are reporting it sounds like the swivel event is not being reported through hp-wmi. Did you add debugging statements inside of hp-wmi.c? If you did and you were not able to get it to show that it is reporting anything, then we need to see the values that are coming from /dev/input/event4. Can you do the evtest again and post the results for /dev/input/event4? We can then see what is coming over and see if it is possible to get it to work with Magick.

Revision history for this message
Stephen Parry (sgparry) said :
#4

Yes, I did put debugging statements into hp-wmi.c - hp_wmi_notify() does
not get called when swivelling. It does get called during other events,
e.g. pressing the WLAN kill switch.

Here is the full output from evtest:

parrysg@mainscreenlx05:~$ sudo evtest /dev/input/event4
Input driver version is 1.0.0
Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab41
Input device name: "AT Translated Set 2 keyboard"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 0 (Reserved)
    Event code 1 (Esc)
    Event code 2 (1)
    Event code 3 (2)
    Event code 4 (3)
    Event code 5 (4)
    Event code 6 (5)
    Event code 7 (6)
    Event code 8 (7)
    Event code 9 (8)
    Event code 10 (9)
    Event code 11 (0)
    Event code 12 (Minus)
    Event code 13 (Equal)
    Event code 14 (Backspace)
    Event code 15 (Tab)
    Event code 16 (Q)
    Event code 17 (W)
    Event code 18 (E)
    Event code 19 (R)
    Event code 20 (T)
    Event code 21 (Y)
    Event code 22 (U)
    Event code 23 (I)
    Event code 24 (O)
    Event code 25 (P)
    Event code 26 (LeftBrace)
    Event code 27 (RightBrace)
    Event code 28 (Enter)
    Event code 29 (LeftControl)
    Event code 30 (A)
    Event code 31 (S)
    Event code 32 (D)
    Event code 33 (F)
    Event code 34 (G)
    Event code 35 (H)
    Event code 36 (J)
    Event code 37 (K)
    Event code 38 (L)
    Event code 39 (Semicolon)
    Event code 40 (Apostrophe)
    Event code 41 (Grave)
    Event code 42 (LeftShift)
    Event code 43 (BackSlash)
    Event code 44 (Z)
    Event code 45 (X)
    Event code 46 (C)
    Event code 47 (V)
    Event code 48 (B)
    Event code 49 (N)
    Event code 50 (M)
    Event code 51 (Comma)
    Event code 52 (Dot)
    Event code 53 (Slash)
    Event code 54 (RightShift)
    Event code 55 (KPAsterisk)
    Event code 56 (LeftAlt)
    Event code 57 (Space)
    Event code 58 (CapsLock)
    Event code 59 (F1)
    Event code 60 (F2)
    Event code 61 (F3)
    Event code 62 (F4)
    Event code 63 (F5)
    Event code 64 (F6)
    Event code 65 (F7)
    Event code 66 (F8)
    Event code 67 (F9)
    Event code 68 (F10)
    Event code 69 (NumLock)
    Event code 70 (ScrollLock)
    Event code 71 (KP7)
    Event code 72 (KP8)
    Event code 73 (KP9)
    Event code 74 (KPMinus)
    Event code 75 (KP4)
    Event code 76 (KP5)
    Event code 77 (KP6)
    Event code 78 (KPPlus)
    Event code 79 (KP1)
    Event code 80 (KP2)
    Event code 81 (KP3)
    Event code 82 (KP0)
    Event code 83 (KPDot)
    Event code 85 (Zenkaku/Hankaku)
    Event code 86 (102nd)
    Event code 87 (F11)
    Event code 88 (F12)
    Event code 89 (RO)
    Event code 90 (Katakana)
    Event code 91 (HIRAGANA)
    Event code 92 (Henkan)
    Event code 93 (Katakana/Hiragana)
    Event code 94 (Muhenkan)
    Event code 95 (KPJpComma)
    Event code 96 (KPEnter)
    Event code 97 (RightCtrl)
    Event code 98 (KPSlash)
    Event code 99 (SysRq)
    Event code 100 (RightAlt)
    Event code 102 (Home)
    Event code 103 (Up)
    Event code 104 (PageUp)
    Event code 105 (Left)
    Event code 106 (Right)
    Event code 107 (End)
    Event code 108 (Down)
    Event code 109 (PageDown)
    Event code 110 (Insert)
    Event code 111 (Delete)
    Event code 112 (Macro)
    Event code 113 (Mute)
    Event code 114 (VolumeDown)
    Event code 115 (VolumeUp)
    Event code 116 (Power)
    Event code 117 (KPEqual)
    Event code 118 (KPPlusMinus)
    Event code 119 (Pause)
    Event code 121 (KPComma)
    Event code 122 (Hanguel)
    Event code 123 (Hanja)
    Event code 124 (Yen)
    Event code 125 (LeftMeta)
    Event code 126 (RightMeta)
    Event code 127 (Compose)
    Event code 128 (Stop)
    Event code 138 (Help)
    Event code 140 (Calc)
    Event code 142 (Sleep)
    Event code 143 (WakeUp)
    Event code 152 (Coffee)
    Event code 155 (Mail)
    Event code 156 (Bookmarks)
    Event code 157 (Computer)
    Event code 158 (Back)
    Event code 159 (Forward)
    Event code 163 (NextSong)
    Event code 164 (PlayPause)
    Event code 165 (PreviousSong)
    Event code 166 (StopCD)
    Event code 172 (HomePage)
    Event code 173 (Refresh)
    Event code 183 (F13)
    Event code 184 (F14)
    Event code 185 (F15)
    Event code 193 (F23)
    Event code 212 (Camera)
    Event code 217 (Search)
    Event code 224 (Brightness down)
    Event code 225 (Brightness up)
    Event code 226 (Media)
    Event code 227 (?)
    Event code 236 (?)
    Event code 238 (?)
    Event code 389 (DVD)
    Event code 465 (?)
  Event type 4 (Misc)
    Event code 4 (ScanCode)
  Event type 17 (LED)
    Event code 0 (NumLock)
    Event code 1 (CapsLock)
    Event code 2 (ScrollLock)
  Event type 20 (Repeat)
Testing ... (interrupt to exit)
Event: time 1297125351.805089, type 4 (Misc), code 4 (ScanCode), value d8
Event: time 1297125351.805114, -------------- Report Sync ------------
Event: time 1297125351.817083, type 4 (Misc), code 4 (ScanCode), value d8
Event: time 1297125351.817102, -------------- Report Sync ------------
Event: time 1297125355.517922, type 4 (Misc), code 4 (ScanCode), value d9
Event: time 1297125355.517945, -------------- Report Sync ------------
Event: time 1297125355.529938, type 4 (Misc), code 4 (ScanCode), value d9
Event: time 1297125355.529970, -------------- Report Sync ------------
Event: time 1297125362.176370, type 4 (Misc), code 4 (ScanCode), value 1d
Event: time 1297125362.176384, type 1 (Key), code 29 (LeftControl), value 1
Event: time 1297125362.176386, -------------- Report Sync ------------
Event: time 1297125362.379933, type 4 (Misc), code 4 (ScanCode), value 2e
Event: time 1297125362.379947, type 1 (Key), code 46 (C), value 1
Event: time 1297125362.379949, -------------- Report Sync ------------

On 08/02/11 00:27, Jayhawk wrote:
> Your question #144254 on Magick Rotation changed:
> https://answers.launchpad.net/magick-rotation/+question/144254
>
> Status: Open => Needs information
>
> Jayhawk requested for more information:
> Thank you for checking into it for me. From what you are reporting it
> sounds like the swivel event is not being reported through hp-wmi. Did
> you add debugging statements inside of hp-wmi.c? If you did and you
> were not able to get it to show that it is reporting anything, then we
> need to see the values that are coming from /dev/input/event4. Can you
> do the evtest again and post the results for /dev/input/event4? We can
> then see what is coming over and see if it is possible to get it to work
> with Magick.
>

Revision history for this message
Jayhawk (the-ayuthias) said :
#5

Thanks again for this information. Unfortunately with the key not being defined for the kernel module I don't think that we want to make permanent code changes to magick to support this. However, you can try making changes to oem_wmi.py. That is where we are handling the event codes. You can try replacing the following section:
            if ev_type == EV_SW:
                if ev_code == SW_TABLET_MODE:
                    hingevalue_toggle = self.win.basic_table.get_hingevalue_toggle()
                    if hingevalue_toggle == False:
                        if ev_val:
                            rotate = ROTATE_TABLET
                        else:
                            rotate = ROTATE_LAPTOP
                    # Added for HP models Compaq TC4200 & 4400
                    else:
                        if ev_val:
                            rotate = ROTATE_LAPTOP
                        else:
                            rotate = ROTATE_TABLET

with:

            if ev_type == 4:
                if ev_code == 4:
                    hingevalue_toggle = self.win.basic_table.get_hingevalue_toggle()
                    if hingevalue_toggle == False:
                        if ev_val == 0xd8:
                            rotate = ROTATE_TABLET
                        elif ev_val == 0xd9:
                            rotate = ROTATE_LAPTOP
                    # Added for HP models Compaq TC4200 & 4400
                    else:
                        if ev_val:
                            rotate = ROTATE_LAPTOP
                        else:
                            rotate = ROTATE_TABLET

By the way, is this the most recent BIOS version for your laptop? I am curious because I was thinking that other tm2 laptops have not experienced this so I am wondering if HP is changing the reporting in the BIOS.

Revision history for this message
Stephen Parry (sgparry) said :
#6

I'll try the patch and let you know how well it works.
The BIOS revision is the lastest from the HP site F.23. I suspect you
are correct - the behaviour of the WMI reporting did seem to change
around revision F.22 - but I cannot state that for definite.
I wonder how Windows 7 detects the swivel?

On 08/02/11 22:55, Jayhawk wrote:
> Your question #144254 on Magick Rotation changed:
> https://answers.launchpad.net/magick-rotation/+question/144254
>
> Jayhawk posted a new comment:
> Thanks again for this information. Unfortunately with the key not being defined for the kernel module I don't think that we want to make permanent code changes to magick to support this. However, you can try making changes to oem_wmi.py. That is where we are handling the event codes. You can try replacing the following section:
> if ev_type == EV_SW:
> if ev_code == SW_TABLET_MODE:
> hingevalue_toggle = self.win.basic_table.get_hingevalue_toggle()
> if hingevalue_toggle == False:
> if ev_val:
> rotate = ROTATE_TABLET
> else:
> rotate = ROTATE_LAPTOP
> # Added for HP models Compaq TC4200 & 4400
> else:
> if ev_val:
> rotate = ROTATE_LAPTOP
> else:
> rotate = ROTATE_TABLET
>
> with:
>
> if ev_type == 4:
> if ev_code == 4:
> hingevalue_toggle = self.win.basic_table.get_hingevalue_toggle()
> if hingevalue_toggle == False:
> if ev_val == 0xd8:
> rotate = ROTATE_TABLET
> elif ev_val == 0xd9:
> rotate = ROTATE_LAPTOP
> # Added for HP models Compaq TC4200 & 4400
> else:
> if ev_val:
> rotate = ROTATE_LAPTOP
> else:
> rotate = ROTATE_TABLET
>
> By the way, is this the most recent BIOS version for your laptop? I am
> curious because I was thinking that other tm2 laptops have not
> experienced this so I am wondering if HP is changing the reporting in
> the BIOS.
>

Revision history for this message
Stephen Parry (sgparry) said :
#7

No go on the patch I'm afraid. The problem is we're reading the wrong
input device; we need to be reading the keyboard input device _as well
as_ reading the WMI input device. Perhaps if we spawn a separate thread,
running a similar class but reading the keyboard? Would reading the
keyboard input device disrupt other applications though?

On 08/02/11 22:55, Jayhawk wrote:
> Your question #144254 on Magick Rotation changed:
> https://answers.launchpad.net/magick-rotation/+question/144254
>
> Jayhawk posted a new comment:
> Thanks again for this information. Unfortunately with the key not being defined for the kernel module I don't think that we want to make permanent code changes to magick to support this. However, you can try making changes to oem_wmi.py. That is where we are handling the event codes. You can try replacing the following section:
> if ev_type == EV_SW:
> if ev_code == SW_TABLET_MODE:
> hingevalue_toggle = self.win.basic_table.get_hingevalue_toggle()
> if hingevalue_toggle == False:
> if ev_val:
> rotate = ROTATE_TABLET
> else:
> rotate = ROTATE_LAPTOP
> # Added for HP models Compaq TC4200 & 4400
> else:
> if ev_val:
> rotate = ROTATE_LAPTOP
> else:
> rotate = ROTATE_TABLET
>
> with:
>
> if ev_type == 4:
> if ev_code == 4:
> hingevalue_toggle = self.win.basic_table.get_hingevalue_toggle()
> if hingevalue_toggle == False:
> if ev_val == 0xd8:
> rotate = ROTATE_TABLET
> elif ev_val == 0xd9:
> rotate = ROTATE_LAPTOP
> # Added for HP models Compaq TC4200 & 4400
> else:
> if ev_val:
> rotate = ROTATE_LAPTOP
> else:
> rotate = ROTATE_TABLET
>
> By the way, is this the most recent BIOS version for your laptop? I am
> curious because I was thinking that other tm2 laptops have not
> experienced this so I am wondering if HP is changing the reporting in
> the BIOS.
>

Revision history for this message
Jayhawk (the-ayuthias) said :
#8

I meant to address that. You can go into /etc/udev/rules.d/62-magick.rules and you can change the "HP WMI hotkeys" section:
ATTRS{name}=="HP WMI hotkeys", SUBSYSTEM=="input", MODE="644" SYMLINK+="input/hp-wmi"

so that it will match the name of the keyboard from xinput --list. That should change the symbolic link and hopefully will get oem_wmi.py to read the correct events.

Revision history for this message
Jayhawk (the-ayuthias) said :
#9

By the way, the other easy way is to remove the symbolic link (the /dev/input/hp-wmi one) and relink it to /dev/input/event4 and then you can test it out:
sudo rm /dev/input/hp-wmi
sudo ln -s /dev/input/event4
sudo chmod 644 /dev/input/event4

Revision history for this message
Jan-Åke Larsson (jalar) said :
#10

Same problem here, tm2-2090. Only difference is /dev/input/hp-wmi is a link to /dev/input/event7, but is just as silent. Keyboard events appear at /dev/input/event3. Tried your patch, changing 62-magick.rules to event3, and an entry in hinge.py, along with testing for ev_type ==3 and so on. Doesn't work. No reaction whatsoever.

Revision history for this message
Jan-Åke Larsson (jalar) said :
#11

Ah, my typo in hinge.py made the whole thing fail. Now I only get

Traceback (most recent call last):
  File "/home/jan-ake/install/magick-rotation/oem_wmi.py", line 15, in run
    fd = open(self.filename, "r")
IOError: [Errno 13] Permission denied: '/dev/input/event3'

event7 is user readable. event3 is not.

Revision history for this message
Jayhawk (the-ayuthias) said :
#12

event7 is user readable. event3 is not.

You will need to change event3 to be readable in the rules if you did not already (MODE=644). Or if you are doing it manually:
sudo chmod 644 /dev/input/event3

That should change it so that it is read only.

Revision history for this message
Jan-Åke Larsson (jalar) said :
#13

And if I do not want raw keyboard events to be directly accessible to every process on the machine?

Revision history for this message
Jayhawk (the-ayuthias) said :
#14

The closest that we can do is to create your own group (using groupadd if I remember correctly) and then you can change the permissions to be 464 so that it will only allow the group to be able to read. Unfortunately it will still allow any applications that you start to have read permissions to the events.

We went this route mainly so that we did not have to use the sudo or root to run magick-rotation. At some point we will try to access the information through some library instead of reading the event directly. It is easier for hp-wmi since it does not transmit too many events, but the keyboard events are a little more of a security risk.

Revision history for this message
Jan-Åke Larsson (jalar) said :
#15

Exactly. Your program might have been useful if the events hadn't been keyboard events. I have deinstalled your program, and instead handle this through simple keyboard shortcuts.

Revision history for this message
Favux (favux-is) said :
#16

Always an option, although perhaps a bit more awkward in usage. And perhaps for the best if you are in a position where you feel key loggers are a real possibility. If you have any concrete alternative security suggestions, or even better, code to propose we look forward to them/it eagerly.

Revision history for this message
Jan-Åke Larsson (jalar) said :
#17

Giving the "advice" to make the raw keyboard user-readable is completely incredible. Please stop doing that. This "solution" will never make it through any security audit worth the name. (But who needs passwords, anyway.) Seriously, choose another way to access the data you need.

The awkward usage is mitigated by not having to install a multi-threaded python app that polls the keyboard repeatedly (I see that less CPU usage was one recent patch) into my own home directory (I am still unsure if I actually could choose installation directory), while also adding stuff deep in the system (in /etc/...).

Why don't you instead create a patch for gnome-display-properties (adding a hotkey for normal/left/right/upside down)?

The "awkward" solution was to add the following to /etc/rc.local:

# Add the HP TM2 laptop/tablet switching keys
setkeycodes e058 153 # "Display"
setkeycodes e059 171 # "Config"

and the following two files:
~/.gconf/desktop/gnome/keybindings/custom0/%gconf.xml
----------------
<?xml version="1.0"?>
<gconf>
        <entry name="action" mtime="1297359184" type="string">
                <stringvalue>xrandr -o left</stringvalue>
        </entry>
        <entry name="name" mtime="1297359184" type="string">
                <stringvalue>Tablet Mode</stringvalue>
        </entry>
        <entry name="binding" mtime="1297357678" type="string">
                <stringvalue>0xa1</stringvalue>
        </entry>
</gconf>
----------------
~/.gconf/desktop/gnome/keybindings/custom0/%gconf.xml
----------------
<?xml version="1.0"?>
<gconf>
        <entry name="action" mtime="1297361250" type="string">
                <stringvalue>xrandr -o normal</stringvalue>
        </entry>
        <entry name="name" mtime="1297361250" type="string">
                <stringvalue>Laptop mode</stringvalue>
        </entry>
        <entry name="binding" mtime="1297359145" type="string">
                <stringvalue>XF86Tools</stringvalue>
        </entry>
</gconf>
----------------

Revision history for this message
Jan-Åke Larsson (jalar) said :
#18

Of course the later two were added through the Preferences->Keyboard Shortcuts. The hard part was the two lines in rc.local.

Revision history for this message
Favux (favux-is) said :
#19

Thank you for sharing your solution for HP TM2's using Karmic or non-Debian/Ubuntu X server 1.7 or less (i.e. HAL). Would have to look into Preferences->Keyboard Shortcuts for non-HAL releases. You do raise a valid concern.

We could address the issue with HP's and ThinkPad's, see method 5 in the Rotation HOW TO: http://ubuntuforums.org/showpost.php?p=6274392&postcount=1 I'm curious if you see the tablet file?

But addressing it for the Dell's and TM2's (with the latest BIOS?) which only seem to report through key codes, and not to a file, may be interesting.

Revision history for this message
Jan-Åke Larsson (jalar) said :
#20

You mean Maverick, xorg-1:7.5. Hmmmmmmm, xinput -list reports "HP WMI hotkeys" as a slave keyboard.

(I do not have the stamina to read that post. Which file was that?)

As regards BIOS, I use the one which came with the machine.

Revision history for this message
Favux (favux-is) said :
#21

Lucid has the hybrid 1.7. Parts of an early version of 1.8 back ported into it to eliminate HAL for xorg.conf.d in a non-standard location. Non-Debian/Ubuntu 1.7's use HAL/.fdi. Maverick has 1.9/xorg.conf.d.

Didn't mean for you to. Near the bottom. The section heading is Method 5.

Revision history for this message
Stephen Parry (sgparry) said :
#22

On 10/02/11 21:59, Jan-Åke Larsson wrote:
> Your question #144254 on Magick Rotation changed:
> https://answers.launchpad.net/magick-rotation/+question/144254
>
> Jan-Åke Larsson proposed the following answer:
> You mean Maverick, xorg-1:7.5. Hmmmmmmm, xinput -list reports "HP WMI
> hotkeys" as a slave keyboard.
>
> (I do not have the stamina to read that post. Which file was that?)
>
> As regards BIOS, I use the one which came with the machine.
>
I can confirm that the device file /sys/devices/platform/hp-wmi/tablet
does indeed exist on my system and that it gives the correct value. I am
trying to fathom how it gets populated in the code. If the device file
is only written to when the state changes and we can pick that up
without polling (using a blocking read?) that would then achieve what we
want. If however it only gets written when you read from it, we're back
to polling again (yuck).

Revision history for this message
Stephen Parry (sgparry) said :
#23

Nuts. It's generated as you read from it :-(
I'm going to dig back in to the Windows 7 WMI object model and see if I
can spot anywhere else the swivel is being raised as an event.

On 10/02/11 22:42, Stephen Parry wrote:
> Your question #144254 on Magick Rotation changed:
> https://answers.launchpad.net/magick-rotation/+question/144254
>
> Status: Answered => Open
>
> You are still having a problem:
> On 10/02/11 21:59, Jan-Åke Larsson wrote:
>> Your question #144254 on Magick Rotation changed:
>> https://answers.launchpad.net/magick-rotation/+question/144254
>>
>> Jan-Åke Larsson proposed the following answer:
>> You mean Maverick, xorg-1:7.5. Hmmmmmmm, xinput -list reports "HP WMI
>> hotkeys" as a slave keyboard.
>>
>> (I do not have the stamina to read that post. Which file was that?)
>>
>> As regards BIOS, I use the one which came with the machine.
>>
> I can confirm that the device file /sys/devices/platform/hp-wmi/tablet
> does indeed exist on my system and that it gives the correct value. I am
> trying to fathom how it gets populated in the code. If the device file
> is only written to when the state changes and we can pick that up
> without polling (using a blocking read?) that would then achieve what we
> want. If however it only gets written when you read from it, we're back
> to polling again (yuck).
>

Revision history for this message
Jayhawk (the-ayuthias) said :
#24

@Jan-Åke Larsson,
I understand and agree with you about the keyboard events being a security issue. There is only optional section that will read the wmi events which are not keyboard events. They only report a few things like the wireless, a docking station signal, and the swivel for the tablets. However, this application also does help rotate the touch and stylus devices and that portion does not need the events there. The application looks too see if there is a symbolic link (the hp-wmi and dell-wmi) available and will use it if it is there. If it is not there, it will not load the swivel event reader application. Magick Rotation actually just waits for the tablet xrandr event to occur.

So if you create a script like yours to rotate the screen, Magick Rotation will still rotate the touch and stylus events. It will still provide you an option to launch applications when the screen is rotated and be able to turn touch on/off.

The plan is to move away from reading the wmi events as we currently have. The wmi event portion was separated from the magick-rotation code so that magick-rotation did not need to be dependent on that portion. It is currently there until we are able to provide a better solution.

Revision history for this message
Stephen Parry (sgparry) said :
#25

Just a thought BTW: in my poking around in the guts of the input
devices, I noticed the tm2 2050 has user readable accelerometers. Would
it not be nice if we had the option of rotation by tilt? I know that one
dev has made this work for the thinkpad tablet on linux.

Revision history for this message
Favux (favux-is) said :
#26

Even better there are a couple of Python scripts for the accelerometer out there. We've talked about adding that as a feature but that's fairly far down on our priority list right now. I think we'd like to add calibration first, for example. Although you having an accelerometer to test with would be helpful. Are you interested in some links? I think I may have them somewhere. Is the accelerometer for the hard drive or do you know?

Revision history for this message
Jan-Åke Larsson (jalar) said :
#27

Best of luck, guys. Signing off.

Can you help with this problem?

Provide an answer of your own, or ask Stephen Parry for more information if necessary.

To post a message you must log in.