To implement a hash function for an aggregate type, a typical solution is simply to std::hash all the members, and combine the resulting hashes with a XOR based formula that you'll find easily on Google.
Reading the keyboard state in a function that operates on a sf::Event instance that may have been produced long ago, is a very bad idea. All the information about modifier keys is inside sf::Event, use that instead.