How to create an animation with the character fixed to a point no matter what happens ?

Hi, I have a project in mind and I would like to create dynamic animations and my character should stay fixed to something, a point on a object for instance. Here are a few examples of what I mean :

  • my character is sitting on a chair, if I move the chair my character should do anything he can to stay on the chair
  • my character is typing on a keyboard, if I move the keyboard the whole body should move to keep typing on the keyboard
  • my character is wearing a hat, if I try to move the hat, his head should stick to the hat and the whole body should move with it
  • my character is driving, holding the steering wheel, if the car crashes the character should do anything he can to keep holding the steering wheel
    I have no idea how achieve this and, if it’s possible, do you guys have some tutorials or some indication to help me ?
    Thanks