it seems that using arduino leonardo is better for only 6 axis & 42 buttons.
it has total 23 pins, 11 internal axis. if I use only 6 axis, there are 17 pins left for button matrix. so 17 is more than enough, for 42 buttons I only need 13 pins. 13 = 6+7 6 colums x 7 rows = 42 buttons.