On my spectre x360 13-4170nz the pen is recognised and I can write, but the keys have no function and cannot be assigned. When I press the upper key, a circle forms around the "drawing point" but this has no effect.
It worked for me right from the start without doing anything (x360 G2). Did you install the latest drivers and did you check if the battery in the pen still has power?