External modulation on thermal convection has been studied extensively to achieve the control of flow structures and heat-transfer efficiency. In this paper, we carry out direct numerical simulations on Rayleigh–Bénard convection accounting for both the modulation of wall shear and roughness over the Rayleigh number range
$1.0 \times 10^6 \le Ra \le 1.0 \times 10^8$
, the wall shear Reynolds number range
$0 \le Re_w \le 5000$
, the aspect-ratio range
$2 \le \varGamma \le 4{\rm \pi}$
, and the dimensionless roughness height range
$0 \le h \le 0.2$
at fixed Prandtl number
$Pr = 1$
. Under the combined actions of wall shear and roughness, with increasing
$Re_w$
, the heat flux is initially enhanced in the buoyancy-dominant regime, then has an abrupt transition near the critical shear Reynolds number
$Re_{w,cr}$
, and finally enters the purely diffusion regime dominated by shear. Based on the crossover of the kinetic energy production between the buoyancy-dominant and shear-dominant regimes, a physical model is proposed to predict the transitional scaling behaviour between
$Re_{w,cr}$
and
$Ra$
, i.e.
$Re_{w,cr} \sim Ra^{9/14}$
, which agrees well with our numerical results. The reason for the observed heat-transport enhancement in the buoyancy-dominant regime is further explained by the fact that the moving rough plates introduce an external shear to strengthen the large-scale circulation (LSC) in the vertical direction and serve as a conveyor belt to increase the chances of the interaction between the LSC and secondary flows within cavities, which triggers more thermal plumes, efficiently transports the trapped hot (cold) fluids outside cavities.