My understanding of trim (on non fly by wire aircrafts) is that when the pilot feels force on his column or side stick, he trims the aircraft (either up/down) until the forces on the stick or yoke are neutralized. But in fly by wire systems, the pilot does not feel any force on the stick or yoke. In such case how does pilot know when to trim the aircraft (be it pitch/roll/rudder trim). Or does flight control computer computes the trim required automatically? In such case, what happens during the direct mode (or alternate law) when flight control computers are no longer in control and pilot commands directly go to actuator controller electronics.
Fly-by-wire just means that the control column is not connected to the control surfaces (hydro-)mechanically, but using digital (electrical or optical) signal wires. That says nothing about how the controls behave. There are two basic ways they can:
The Boeing way:
Force and position is transmitted in both directions, emulating control with mechanical link. The pilot feels force on the control surfaces and trims as usual.
The Airbus way:
The position of the control column corresponds to wing loading in pitch and roll rate in roll axis. The computer manipulates the controls to achieve the target values. The control column is spring-loaded, so force always corresponds to position.
The trim is operated by the computer to balance the control surface for wing loading of 1 G (or is not a separate control at all as in case of FBW fighters with all moving stabilator).
But when the system is in direct law (during take-off or if degraded due to fault), the trim still works more or less normally. The centred position of control stick corresponds to the trimmed position of the control surface, so if the pilot feels force on the control stick, because it is displaced, they dial trim and reduce pressure on the stick until the plane flies straight with the stick centred.
The Airbus way is used on Airbus A320 and all newer models, Sukhoi Su100 and some fighters (since F16).
The Boeing way is used on Boeing 777, 787 and, IIRC, some regional jets.