online icon indicating copy to clipboard operation
online copied to clipboard

Replace magic numbers with keycode constants

Open eszkadev opened this issue 3 years ago • 1 comments

This is an Easy Hack. Potential mentors: @eszkadev

Detailed description and rationale

There are directly provided numbers for key codes in some places. We can use already defined constant variables. This makes code more readable and obvious. We don't have to comment every place with human readable label.

Code pointers

Example: instead of 112 -> KeyCode.F1 in https://github.com/CollaboraOnline/online/blob/master/browser/src/map/handler/Map.Keyboard.js#L331

Links to related documentation

Here is example map with number (KeyCode) -> UNOCode binding: https://github.com/CollaboraOnline/online/blob/master/browser/src/map/handler/Map.Keyboard.js#L20 we want something similar but rather: Name -> KeyCode number like: F1: 112 so later we can use KeyCode.F1 instead of 112

eszkadev avatar Jun 20 '22 17:06 eszkadev

hey can i work on this issue?? we only need to change it to KeyCode.F1??

kakkarot0 avatar Sep 09 '22 17:09 kakkarot0

@eszkadev Please assign it to me. I think this would be doable for me as I am a complete newbie

callmetushar123 avatar Oct 01 '22 05:10 callmetushar123

done with: https://github.com/CollaboraOnline/online/pull/5319

Thanks @callmetushar123

eszkadev avatar Oct 14 '22 09:10 eszkadev