pi-topUtils 1.05

Keyboard/HID driver and battery indicator for pi-top laptops
TimoHartong
Posts: 8
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong »

I did send you the USB dump by email
JonAbbott
Posts: 3066
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-top utilities

Post by JonAbbott »

TimoHartong wrote: Wed Oct 10, 2018 9:04 pm Initial tests look good. However It seems that the keyboard function keys are not working as expected.
They're possibly different key values. Without pitopUtils loaded, run the code below and let me know what it outputs when you press F1 thru F12:

Code: Select all

DIM data% 256
PRINT "Press ESC to quit"
quit%=FALSE
H%=FNfind_HID("USB$Device_00_00_00_258A_000C_*")
IF H%=0 THEN PRINT "Failed to connect":END
P%=OPENIN("devices#endpoint1:USB"+CHR$(H%))
REPEAT
  PRINT
  FOR A%=0 TO 7
    B%=BGET#P%:IF B%=&29 quit%=TRUE
    PRINT ;RIGHT$(STR$~(B%+&100),2);" ";
  NEXT
UNTIL quit%
CLOSE #P%
OSCLI "USBReset "+CHR$(H%)
END

DEF FNfind_HID(HID$)
  SYS "XOS_ReadVarVal", HID$, data%, &100, 0, 3 TO ; E%
  IF (E% AND 1)=1 THEN =0
=?data%
TimoHartong
Posts: 8
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong »

Hi Sorry for the delay but I was looking at the ROOL forum ;-).

The results are :
F1
00 00 00 00 00 00 00 00
00 00 68 00 00 00 00 00
F1
00 00 00 00 00 00 00 00
00 00 68 00 00 00 00 00
F2
00 00 00 00 00 00 00 00
00 00 69 00 00 00 00 00
F3
00 00 00 00 00 00 00 00
00 00 6A 00 00 00 00 00
F4
00 00 00 00 00 00 00 00
00 00 6B 00 00 00 00 00
F5
00 00 00 00 00 00 00 00
00 00 6C 00 00 00 00 00
F7
00 00 00 00 00 00 00 00
00 00 6D 00 00 00 00 00
F8
00 00 00 00 00 00 00 00
00 00 6E 00 00 00 00 00
F9 and F10 no data
F11
00 00 00 00 00 00 00 00
F12
00 00 00 00 00 00 00 00
ESC
00 00 00 00 00 00 00 00
00 00 29 00 00 00 00 00 >
JonAbbott
Posts: 3066
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-top utilities

Post by JonAbbott »

They're the standard keycodes, so the F-keys should work correctly provided you alter pitopUtils$DeviceID in !Run to:

Code: Select all

Set pitopUtils$DeviceID USB$Device_00_00_00_258A_000C_*
TimoHartong
Posts: 8
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong »

Unfortenately no luck there. I tried but no direct reaction to function keys
JonAbbott
Posts: 3066
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-top utilities

Post by JonAbbott »

Hmm, that makes no sense :? I'll add some more detail to the debug build so we can see what's going on.
JonAbbott
Posts: 3066
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-top utilities

Post by JonAbbott »

Attached (now removed) are the latest builds for testing on the pi-top2.

Load !Reporter prior to running the debug build, then see if holding keys reports key down events with the following values. Note that the F-keys are reversed, so you don't need to hold FN for them, but do need to hold FN for the volume/brightness controls.

Also note HID keys don't generate specific key up events, so you'll see two extra key up events whenever you press/release one of the volume controls.

Code: Select all

A              - 004
F1             - 068
F8             - 100 (HID data: E2)
F9             - 200 (HID data: EA)
F10            - 300 (HID data: E9)
F11            - 06F
F12            - 070
Mute           - 041
Vol-           - 042
Vol+           - 043
Brightness-    - 044
Brightness+    - 045
Command prompt - 072
NumLock        - 073
Left menu      - 0E3
Right menu     - 0E7
I'm assuming the left/right menu keys are relabelled pi-top keys, so let me know if they're different values from the above. Could you also confirm what the Power key returns so I can implement it.
TimoHartong
Posts: 8
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong »

Hi,

!Reporter running after that pi-TopUtils106Debug and after that the machine freezes immidiately ;-(.
JonAbbott
Posts: 3066
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-top utilities

Post by JonAbbott »

I've added some additional debugging during initialisation, download and try again. Let me know the last thing Reporter shows when it hangs.
TimoHartong
Posts: 8
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong »

Image
See the picture
Post Reply