Looks good. I think it can be improved by changing the alignment of the pattern so that each white key is drawn with the same alignment relative to the position of the key.compromise:
active white notes with 33% gray
active black notes with 50% gray
With the current alignment (relative to the window position), you see that the appearance of hilited white keys repeats every 4 keys. Every two keys has a dividing black line that appears darker then the dividing black line to the left or right. This is the phase problem I mentioned previously. The alignment can be changed using SetPortPenLocation or SetPenState. Choose a pnLoc, relative to the location of the white key, that gives the best appearance of a white key or a black key. The alignment of the pattern in the third or fourth hilted white key seems best - they don't have a corner black pixel at the bottom like the two left or two right hilited white keys do. Or maybe you prefer having the pixel in the corner.
The interior of a white key is 8 pixels which happens to be the width of a pattern. The pattern would look best if the white keys were 1 pixel wider or narrower, so that the left and right edges will have similar appearance but then maybe the keyboard wouldn't fit in your window or the keyboard keys would be too narrow.
Fixed-size 8x8 patterns can only repeat every 2, 4, or 8 pixels vertically and horizontally. The 33% gray pattern repeats vertically every 2 pixels and horizontally every 4 pixels.
Current appearance of the pattern (0 and 1) of a white key with border pixels B:
B 1000 1000 B
B 0010 0010 B
Making the white key one pixel wider makes the pattern more symmetric between the border pixels:
B 0 1000 1000 B
B 0 0010 0010 B
Or one pixel narrower:
B 1000 100 B
B 0010 001 B