Okay back to the old text stuff for now :( Let's fix scroll feel by multiplying in the screen scale factor? Why not right?

master
Allen Webster 2020-05-01 18:31:28 -07:00
parent 67e294c0d5
commit 3c77835e6f
3 changed files with 9 additions and 14 deletions

View File

@ -25,7 +25,11 @@ custom_layer_init(Application_Links *app){
// NOTE(allen): default hooks and command maps // NOTE(allen): default hooks and command maps
set_all_default_hooks(app); set_all_default_hooks(app);
mapping_init(tctx, &framework_mapping); mapping_init(tctx, &framework_mapping);
#if OS_MAC
setup_mac_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code);
#else
setup_default_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code); setup_default_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code);
#endif
} }
#endif //FCODER_DEFAULT_BINDINGS #endif //FCODER_DEFAULT_BINDINGS

View File

@ -1046,15 +1046,11 @@ set_all_default_hooks(Application_Links *app){
set_custom_hook(app, HookID_Tick, default_tick); set_custom_hook(app, HookID_Tick, default_tick);
set_custom_hook(app, HookID_RenderCaller, default_render_caller); set_custom_hook(app, HookID_RenderCaller, default_render_caller);
set_custom_hook(app, HookID_WholeScreenRenderCaller, default_whole_screen_render_caller); set_custom_hook(app, HookID_WholeScreenRenderCaller, default_whole_screen_render_caller);
#if 0
set_custom_hook(app, HookID_DeltaRule, original_delta);
set_custom_hook_memory_size(app, HookID_DeltaRule,
delta_ctx_size(original_delta_memory_size));
#else
set_custom_hook(app, HookID_DeltaRule, fixed_time_cubic_delta); set_custom_hook(app, HookID_DeltaRule, fixed_time_cubic_delta);
set_custom_hook_memory_size(app, HookID_DeltaRule, set_custom_hook_memory_size(app, HookID_DeltaRule,
delta_ctx_size(fixed_time_cubic_delta_memory_size)); delta_ctx_size(fixed_time_cubic_delta_memory_size));
#endif
set_custom_hook(app, HookID_BufferNameResolver, default_buffer_name_resolution); set_custom_hook(app, HookID_BufferNameResolver, default_buffer_name_resolution);
set_custom_hook(app, HookID_BeginBuffer, default_begin_buffer); set_custom_hook(app, HookID_BeginBuffer, default_begin_buffer);

View File

@ -914,7 +914,7 @@ mac_toggle_fullscreen(void){
- (BOOL)resignFirstResponder{ - (BOOL)resignFirstResponder{
return(YES); return(YES);
} }
#if 0
- (void)insertText:(NSString*)text{ - (void)insertText:(NSString*)text{
u32 len = [text length]; u32 len = [text length];
Scratch_Block scratch(mac_vars.tctx); Scratch_Block scratch(mac_vars.tctx);
@ -943,15 +943,11 @@ mac_toggle_fullscreen(void){
system_signal_step(0); system_signal_step(0);
} }
#endif
- (void)keyDown:(NSEvent*)event{ - (void)keyDown:(NSEvent*)event{
// NOTE(yuval): Process keyboard event // NOTE(yuval): Process keyboard event
[self process_keyboard_event:event down:true]; [self process_keyboard_event:event down:true];
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
#if 0
// NOTE(yuval): Process TextInsert event // NOTE(yuval): Process TextInsert event
{ {
NSString *characters = [event characters]; NSString *characters = [event characters];
@ -993,7 +989,6 @@ mac_toggle_fullscreen(void){
} }
} }
} }
#endif
} }
- (void)keyUp:(NSEvent*)event{ - (void)keyUp:(NSEvent*)event{
@ -1047,7 +1042,7 @@ mac_toggle_fullscreen(void){
- (void)scrollWheel:(NSEvent *)event{ - (void)scrollWheel:(NSEvent *)event{
f32 dx = event.scrollingDeltaX; f32 dx = event.scrollingDeltaX;
f32 dy = event.scrollingDeltaY; f32 dy = event.scrollingDeltaY;
mac_vars.input_chunk.trans.mouse_wheel = (i32)(-dy); mac_vars.input_chunk.trans.mouse_wheel = (i32)(-dy*mac_vars.screen_scale_factor);
system_signal_step(0); system_signal_step(0);
} }