mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 23:34:57 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
e27162df0b
@ -639,9 +639,14 @@ if (COMPILER == "MSVC"):
|
|||||||
if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
|
if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
|
||||||
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
|
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
|
||||||
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
|
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
|
||||||
else:
|
elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
|
||||||
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
|
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
|
||||||
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
|
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
|
||||||
|
else:
|
||||||
|
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
|
||||||
|
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
|
||||||
|
LibName("OPENSSL", "crypt32.lib")
|
||||||
|
LibName("OPENSSL", "ws2_32.lib")
|
||||||
if (PkgSkip("PNG")==0):
|
if (PkgSkip("PNG")==0):
|
||||||
if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
|
if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
|
||||||
LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
|
LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
|
||||||
|
@ -1929,11 +1929,14 @@ handle_wheel_event(double x, double y) {
|
|||||||
_input->button_up(MouseButton::wheel_down());
|
_input->button_up(MouseButton::wheel_down());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: check if this is correct, I don't own a MacBook
|
if (x != 0 && cocoa_invert_wheel_x) {
|
||||||
if (x > 0.0) {
|
x = -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x < 0.0) {
|
||||||
_input->button_down(MouseButton::wheel_right());
|
_input->button_down(MouseButton::wheel_right());
|
||||||
_input->button_up(MouseButton::wheel_right());
|
_input->button_up(MouseButton::wheel_right());
|
||||||
} else if (x < 0.0) {
|
} else if (x > 0.0) {
|
||||||
_input->button_down(MouseButton::wheel_left());
|
_input->button_down(MouseButton::wheel_left());
|
||||||
_input->button_up(MouseButton::wheel_left());
|
_input->button_up(MouseButton::wheel_left());
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
NotifyCategoryDecl(cocoadisplay, EXPCL_PANDA_COCOADISPLAY, EXPTP_PANDA_COCOADISPLAY);
|
NotifyCategoryDecl(cocoadisplay, EXPCL_PANDA_COCOADISPLAY, EXPTP_PANDA_COCOADISPLAY);
|
||||||
|
|
||||||
|
extern ConfigVariableBool cocoa_invert_wheel_x;
|
||||||
|
|
||||||
extern EXPCL_PANDA_COCOADISPLAY void init_libcocoadisplay();
|
extern EXPCL_PANDA_COCOADISPLAY void init_libcocoadisplay();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,6 +31,11 @@ ConfigureFn(config_cocoadisplay) {
|
|||||||
init_libcocoadisplay();
|
init_libcocoadisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigVariableBool cocoa_invert_wheel_x
|
||||||
|
("cocoa-invert-wheel-x", false,
|
||||||
|
PRC_DESC("Set this to true to swap the wheel_left and wheel_right mouse "
|
||||||
|
"button events, to restore to the pre-1.10.12 behavior."));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the library. This must be called at least once before any of
|
* Initializes the library. This must be called at least once before any of
|
||||||
* the functions or classes in this library can be used. Normally it will be
|
* the functions or classes in this library can be used. Normally it will be
|
||||||
|
@ -16,6 +16,18 @@
|
|||||||
|
|
||||||
#if defined(__APPLE__) && !defined(CPPPARSER)
|
#if defined(__APPLE__) && !defined(CPPPARSER)
|
||||||
|
|
||||||
|
static ConfigVariableBool iokit_scan_mouse_devices
|
||||||
|
("iokit-scan-mouse-devices", false,
|
||||||
|
PRC_DESC("Set this to true to enable capturing raw mouse data via IOKit on "
|
||||||
|
"macOS. This is disabled by default because newer macOS versions "
|
||||||
|
"will prompt the user explicitly for permissions when this is on."));
|
||||||
|
|
||||||
|
static ConfigVariableBool iokit_scan_keyboard_devices
|
||||||
|
("iokit-scan-keyboard-devices", false,
|
||||||
|
PRC_DESC("Set this to true to enable capturing raw keyboard data via IOKit on "
|
||||||
|
"macOS. This is disabled by default because newer macOS versions "
|
||||||
|
"will prompt the user explicitly for permissions when this is on."));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the input device manager by scanning which devices are currently
|
* Initializes the input device manager by scanning which devices are currently
|
||||||
* connected and setting up any platform-dependent structures necessary for
|
* connected and setting up any platform-dependent structures necessary for
|
||||||
@ -34,15 +46,22 @@ IOKitInputDeviceManager() {
|
|||||||
int page = kHIDPage_GenericDesktop;
|
int page = kHIDPage_GenericDesktop;
|
||||||
int usages[] = {kHIDUsage_GD_GamePad,
|
int usages[] = {kHIDUsage_GD_GamePad,
|
||||||
kHIDUsage_GD_Joystick,
|
kHIDUsage_GD_Joystick,
|
||||||
kHIDUsage_GD_Mouse,
|
kHIDUsage_GD_MultiAxisController,
|
||||||
kHIDUsage_GD_Keyboard,
|
0, 0, 0};
|
||||||
kHIDUsage_GD_MultiAxisController, 0};
|
|
||||||
int *usage = usages;
|
int num_usages = 3;
|
||||||
|
if (iokit_scan_mouse_devices) {
|
||||||
|
usages[num_usages++] = kHIDUsage_GD_Mouse;
|
||||||
|
}
|
||||||
|
if (iokit_scan_keyboard_devices) {
|
||||||
|
usages[num_usages++] = kHIDUsage_GD_Keyboard;
|
||||||
|
}
|
||||||
|
|
||||||
// This giant mess is necessary to create an array of match dictionaries
|
// This giant mess is necessary to create an array of match dictionaries
|
||||||
// that will match the devices we're interested in.
|
// that will match the devices we're interested in.
|
||||||
CFMutableArrayRef match = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
|
CFMutableArrayRef match = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
|
||||||
nassertv(match);
|
nassertv(match);
|
||||||
|
int *usage = usages;
|
||||||
while (*usage) {
|
while (*usage) {
|
||||||
CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
CFMutableDictionaryRef dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||||
CFNumberRef page_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);
|
CFNumberRef page_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);
|
||||||
|
@ -158,3 +158,17 @@ void FLOATNAME(LPlane)::
|
|||||||
write(std::ostream &out, int indent_level) const {
|
write(std::ostream &out, int indent_level) const {
|
||||||
indent(out, indent_level) << *this << "\n";
|
indent(out, indent_level) << *this << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of this LPlane.
|
||||||
|
*/
|
||||||
|
std::string FLOATNAME(LPlane)::
|
||||||
|
__repr__() const {
|
||||||
|
std::ostringstream out;
|
||||||
|
out << "LPlane" << FLOATTOKEN << "("
|
||||||
|
<< MAYBE_ZERO(_v(0)) << ", "
|
||||||
|
<< MAYBE_ZERO(_v(1)) << ", "
|
||||||
|
<< MAYBE_ZERO(_v(2)) << ", "
|
||||||
|
<< MAYBE_ZERO(_v(3)) << ")";
|
||||||
|
return out.str();
|
||||||
|
}
|
||||||
|
@ -61,6 +61,7 @@ PUBLISHED:
|
|||||||
|
|
||||||
void output(std::ostream &out) const;
|
void output(std::ostream &out) const;
|
||||||
void write(std::ostream &out, int indent_level = 0) const;
|
void write(std::ostream &out, int indent_level = 0) const;
|
||||||
|
std::string __repr__() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
INLINE_MATHUTIL std::ostream &
|
INLINE_MATHUTIL std::ostream &
|
||||||
|
Loading…
x
Reference in New Issue
Block a user