I am probably able to understand fully more the situation you are in, I've also been in such a situation with a damn gun in my face.
If i recall well, they didn't take much from me (maybe around 30$ or so) since its all i really had, not even a cell.
With such people you have to know one main thing, despite how cray, messed up, and stupid they are, and they have a gun, the last thing they want is a dead body in the street, so you can rule out the fact that they probably wont kill you. The gun helped them in this case, since even though you guys were probably more than them, you couldn't do anything because of the thing
what you did with your book back thing is genius, ive been doing it ever since; for robbers, muggers etc. they always look for the easiest catch; they wont make such of a fuss going through your bag.
i've been keeping all my valuables in a bag (in a very sneaky pocket, and like only 10$ in my wallet, for if i ever will be in such a situation, id just give him the wallet, and run away screaming like a little girl) and to be honest it just feels safer.