I got an 2017 HP Spectre x2 that comes with its own pen. After testing it with various programs like sketch, autodes sketch and paint, with photoshop it stops working after using it after 2 or 5 minutes. I does not happen with any other program. I did the latest update and still it happens.
HP told me to do a factory reset and update everything in windows 10 home. I did. It still happen. I am wondering what is happening with photoshop or it might be my device?
You may try two things here.
1. Rest the Photoshop preferences back to default and check if that helps. Refer: Preferences in Photoshop
2. Update the latest driver software for HP Spectre x2 from the manufacturer's website.