xP: handle M-a and M-! bindings from xC
This commit is contained in:
		@@ -614,3 +614,26 @@ let Main = {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
window.addEventListener('load', () => m.mount(document.body, Main))
 | 
			
		||||
 | 
			
		||||
document.addEventListener('keydown', event => {
 | 
			
		||||
	if (rpc.ws == undefined || event.ctrlKey || event.metaKey)
 | 
			
		||||
		return
 | 
			
		||||
 | 
			
		||||
	if (event.altKey && event.key == 'a') {
 | 
			
		||||
		for (const [name, b] of buffers)
 | 
			
		||||
			if (name !== bufferCurrent && b.newMessages) {
 | 
			
		||||
				rpc.send({command: 'BufferActivate', bufferName: name})
 | 
			
		||||
				break
 | 
			
		||||
			}
 | 
			
		||||
		return event.preventDefault()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (event.altKey && event.key == '!') {
 | 
			
		||||
		for (const [name, b] of buffers)
 | 
			
		||||
			if (name !== bufferCurrent && b.highlighted) {
 | 
			
		||||
				rpc.send({command: 'BufferActivate', bufferName: name})
 | 
			
		||||
				break
 | 
			
		||||
			}
 | 
			
		||||
		return event.preventDefault()
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user