Here's what I do to lock my HJC CS-12 helmet to my 500R: I have a short section of chain that I run through the helmet D-ring. I put the rear footpeg down & open the helmet lock, leaving a small part of the lock peg protruding from the lock. With the helmet facing rearward (D-ring on top), I insert the end of the chain closest to me through the other end of the chain. Resting the helmet on the rear footpeg, I'm just able to loop the end of the chain over the lock peg. Then, I fully close the lock & remove the key. If necessary, I adjust the helmet so that it won't roll while resting on the footpeg.
A few notes: 1) for strength, I chose a chain sized to barely fit through the D-ring; 2) to keep the helmet from rolling around, the chain is just long enough to allow it to loop over the lock peg with the helmet flush against the side of the bike; 3) sometimes, I have to slide the helmet forward or backward on the footpeg to find the right position where the chain is long enough.
They say Necessity is the Mother of Invention. I developed this method because there wasn't enough room in my locker for my gym bag, riding gear, and helmet. It's also nice to be able to go into a restaurant or store and to not have to fool with a helmet. It took me a while to get used to this technique, but now it's second nature. HTH