Handling "the barrel of a gun" does not mean you have to fire it. China just made a combination of statements (notably the fact that the New Territories reprensenting 75% of HK's land were on a lease expiring in 1997, that they would not negociate on) and threats that resulted in the UK handing over HK on a platter. At that time (1997) HK by itself represented 15% of all of China's GDP, so Beijing definitely gained quite a lot by acting tough, even if they never had to pull the trigger.