As per the Great Writer in Gujarat Mr.Thakkar has written a good book to understand the Karma.
The Karma is Done by Body, Mind and Speech.
Body have 10 Senses Known as; 5 karmendriyas (Organs of Actions) and 5 Gyanendriyas (organs of Senses) All Karma are done by that, by body.
Mind have Buddhi (intellect), Ahamkara (Ego) and Mind have five consciousness. There is require to understand mind, beyond being mind. Mind have five states of consciousness in human forms.
Jagruti - Waking
Swapna - Dreaming
Sushupti - Deep Sleep (slumber)
Turiya - Underlying state in all the above states
Unmani or Turyateeta - State of enlightened beings where the cosmos is experienced as oneness.
And Third One is Speech.
Now, refer Gunas; Which are also known as prakriti. There are Three Gunas. These three gunas are called: [sattva] (goodness, constructive, harmonious), [rajas] (passion, active, confused), and [tamas] (darkness, destructive, chaotic). In short Satva is Positive create Punya (Righteousness), Rajas is Neutral neither create punya (Righteousness) or Pap (sin) and Tamas only creates pap (Sin).
These three Gunas are the base of all the activities we done. Only Karma is not have its fruit, its depend on the Gunas. The Example Given by Mr.Thakkar were not totally show true picture, but its lead to right understanding of Karma and its Gati (Result). There is Karma and its Fal (Fruits) which are as per Gunas.
For Example: For Doing Karma. Like if it is stated that A will kill B
--Now Sattva People will join military or police and for stopping the B from doing Illegal Act A fire a Gun and B will Die, As per the mental feeling of A have Virtues, So A do its Karma and also Gain Punya (righteousness).
--If There is Rajas Karma, A will try to clear its Gun, and sudden that fire and kill B, it this action (karma) the feeling of the A is neither right nor to do something wrong, its neutral, so that will neither create righteousness nor sin.
--If there is Tamas karma, A would be either thief or to gain something by illegal way, kill B, The mental feeling is to do something wrong, so in result, A Do Karma as its written that A will do it, and also create the Sin.
So By doing Karma, A if do Satva, do karma and have righteousness, if Rajas neither righteousness nor sin, If Tamas do karma and create the Sin (for which he pay the price).
Now see how Fruit are received by Satva, Rajas And Tamas. It is said that A must die by Gun Shot
-- Now if A is to gain Good Fruit by even facing the Fruit of its past karma, A will join the military, or police and Get the shot and as he had feeling to do something good, as fulfilling duty, He get the Fruit, and also create righteousness.
-- If he has to get result as Rajas, he try to clean the gun and suddenly bullet fired from gun, as the mind of the A is neutral and he neither want to do right nor wrong he will neither get righteousness nor sin in his account of Karma and Fruit.
--If There is Tamas Karma, A will try to theft or do wrong thing and get shot by police, and that will create sin.
So As per three Gunas the person do Karma, and also get the fruit.
If There is decided that, as per karma of the A he will Get Rs.1,00,000/-; If he want to act as Satva, he would do some prestigious work and will get honour price, so he get the money and also create righteousness. if he get by lottery or from some place, as person have neutral mind and feeling, neither righteousness nor sin will created in Karma Account, If person would act under effect of Tamas he would do some wrong act, theft the money, or by extortion, and create sin.
Karma are connected with the Gunas and Mental Status. Karma are depend on feeling (bhava) like Hug to Mother, Hug to Wife or Hug to Daughter is Act of Hug, but the feeling are different and create different righteousness or Sin in Karma Account.