Does the view pan to a set position? I.E. when you press the keyboard key once(by moving the hat), the view moves to a position and stays there?
If all you need is being able to hold the hat to look in a given direction, then release it to recenter, that's relatively simple:
Press NumPad 6 key and hold for 0,06 seconds and release
Start Loop While : Joystick 1 Button 1 Is Pressed OR Joystick 1 Button 2 Is Pressed OR Joystick 1 Button 3 Is Pressed OR Joystick 1 Button 4 Is Pressed
End Loop
Press NumPad 5 key and hold for 0,06 seconds and release
The command would press num6, wait until you none of the hat's POV directions are pressed, then center the view. If you roll the hat around multiple directions without centering, it'll center multiple times when you release it, but that shouldn't be an issue in most games.
Obviously you'd want to use the relevant keyboard keys and joystick buttons for your application instead(and probably add four more directions to the loop check, if you're using an eight-way hat).
If the view moves continuously while you hold the hat, you'd need to use a timeout(E.G. you can move the view for as long as you want, but if you stop for 1 second it'll center).