Are you wanting to know because you prefer to know the coding behind it or just that you would prefer to be able to control the position? If you want the easier way, it would be to install the Xposed Framework and a module like Gravity Box. From what I have read, it's a huge hassle to edit everything needed to get this to work right. You might find some helpful info here: http://android-developers.blogspot.c...nu-button.html
about how this stuff is implemented in code. Unless you really just wanna figure it out for the sake of figuring it out and learning, go with the Xposed mod. Alternative, you could look into http://forum.xda-developers.com/show....php?t=2270198
Need some help, advice, something fixed? Hit me up on Hangouts @ es0tericcha0s and check out my site: http://mobilemojo5280.com
for more info!
HTC Droid Eris / Motorola Droid / Samsung Galaxy S Fascinate / Motorola Droid X / LG G2x / HTC Evo 3D (x2) / Samsung Epic 4G Touch (Sprint S2) / HTC Amaze / Samsung Galaxy S3 (International) / Samsung Galaxy Note 2 / Nexus 4 / HTC One / Samsung Galaxy S4 / Sony Xperia ZL / Nexus 5 / ? (One+1 maybe...)