在实现客服系统的过程中,实现了ctrl+enter作为换行,enter作为发送的事件

<script type="text/javascript" >
$("body").keypress(function(e){
if(e.ctrlKey && e.which == 13 || e.which == 10) {
//处理
}
else if (e.shiftKey && e.which==13 || e.which == 10) {
//要执行的操作
}
})
ie判断e.which == 10 其他浏览器判断 e.which == 13

edge的e.which为10