Before deep diving into the controller, clone the following GitHub repository to your PC. The code is itself around 350+ lines so some parts are to be discussed:
https://github.com/avirup171/bet_controller_urc
So initially let's design the UI first:

For simplicity two sections of fast and slow controls are included. However it can be merged into one and using a checkbox. We have a connection pane on the right hand top side. The commands are displayed. A default password for 12345 was added which was done to avoid crashes and unauthorized use. However it's a simple controller and can be used with UGVs pretty much efficiently.
If you have a close look over the UI, then you will find a button named Press to activate keyboard control. Once you click on the button, the keyboard control gets activated. Now here you need to assign keyboard pressed and keyboard...