pi-top utilities

Discuss development specific to the Pi version of ADFFS
TimoHartong
Posts: 4
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong » Wed Oct 10, 2018 9:17 pm

I did send you the USB dump by email

JonAbbott
Posts: 2061
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Wed Oct 10, 2018 11:48 pm

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: 4
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong » Sun Oct 14, 2018 1:35 pm

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: 2061
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Mon Oct 15, 2018 10:25 am

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: 4
Joined: Wed Oct 10, 2018 8:44 pm

Re: pi-top utilities

Post by TimoHartong » Tue Oct 16, 2018 7:09 pm

Unfortenately no luck there. I tried but no direct reaction to function keys

JonAbbott
Posts: 2061
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Tue Oct 16, 2018 7:19 pm

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: 2061
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: pi-top utilities

Post by JonAbbott » Wed Oct 17, 2018 11:06 am

Attached 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.
Attachments
pi-topUtils106Debug.zip
(11.73 KiB) Not downloaded yet
pi-topUtils106.zip
(11.48 KiB) Not downloaded yet

Post Reply