in ubuntu both mouse pad key working same

C++
//run this command in your terminal window//
gsettings set org.gnome.desktop.peripherals.touchpad click-method areas

Source

Also in C++: