If they're working loose you probably need to file the faces of the pins a bit, so that they fit snugly on the axle. You should be able to work out which bits are touching and which bits aren't, so you file that area.
But I have to agree hammering is a pain in the arse. I think my BB is starting to get loose from it. I think there's a thing called a cotter pin press which does this better than a hammer.
If they're working loose you probably need to file the faces of the pins a bit, so that they fit snugly on the axle. You should be able to work out which bits are touching and which bits aren't, so you file that area.
But I have to agree hammering is a pain in the arse. I think my BB is starting to get loose from it. I think there's a thing called a cotter pin press which does this better than a hammer.