Completely disable hardware and software buttons I want to completely disable the three on-screen buttons (Back, Home, Recents) and any other hardware button. I am aware that I cannot do this from the application since that would be a major security flaw. How would I do this to a device assuming that I have the device on hand? Gain root access and then how would this go?

Ps: What I am trying to do is to have the app run on my tablet on a kiosk and I do not want the users to pressing any buttons.
Full!screen has a (paid-for) feature where you can automatically hide system bars in certain apps and unhide them in other apps, but there is a free version without the automation.

Alternatively, you can hide them completely over ADB (source) with:

adb shell
su
pm disable com.android.systemui


Or (if you're writing your own app) you can use this code (source):

private void hideNavigationBar(){
        try {
            Process process = Runtime.getRuntime().exec("su");
            DataOutputStream os = new DataOutputStream(process.getOutputStream());
            os.writeBytes("pm disable com.android.systemui\n");
            os.flush();
            os.writeBytes("exit\n");
            os.flush();
            process.waitFor();
            //////////////////////////////////////
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


Kiosk Browser Lockdown also has a feature where you can disable all system dialogs (volume, long-press power etc.)