Page 7 of 8

Re: pi-top utilities

Posted: Wed Oct 10, 2018 9:17 pm
by TimoHartong
I did send you the USB dump by email

Re: pi-top utilities

Posted: Wed Oct 10, 2018 11:48 pm
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%

Re: pi-top utilities

Posted: Sun Oct 14, 2018 1:35 pm
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 >

Re: pi-top utilities

Posted: Mon Oct 15, 2018 10:25 am
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_*

Re: pi-top utilities

Posted: Tue Oct 16, 2018 7:09 pm
by TimoHartong
Unfortenately no luck there. I tried but no direct reaction to function keys

Re: pi-top utilities

Posted: Tue Oct 16, 2018 7:19 pm
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.

Re: pi-top utilities

Posted: Wed Oct 17, 2018 11:06 am
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.

Re: pi-top utilities

Posted: Sat Oct 20, 2018 12:33 pm
by TimoHartong
Hi,

!Reporter running after that pi-TopUtils106Debug and after that the machine freezes immidiately ;-(.

Re: pi-top utilities

Posted: Sat Oct 20, 2018 10:20 pm
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.

Re: pi-top utilities

Posted: Sun Oct 21, 2018 10:59 am
by TimoHartong
Image
See the picture