How do i longpress on a hardware key code - 123 by appium? Could anyone help me please?

I have a keycode/keyevent 123
I am using “adb shell input keyevent 123” for a single keypress by execution script.
but I want to long-press on that key event for a moment like 30 second.

Any help appreciated.